Skip to content

[WIP] Add Fireworks backend - #1948

Draft
CharlieFRuan wants to merge 2 commits into
mainfrom
fireworks
Draft

[WIP] Add Fireworks backend#1948
CharlieFRuan wants to merge 2 commits into
mainfrom
fireworks

Conversation

@CharlieFRuan

Copy link
Copy Markdown
Member

No description provided.

@CharlieFRuan
CharlieFRuan marked this pull request as draft July 27, 2026 23:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a dedicated Fireworks Training API backend for SkyRL, implementing both synchronous and fully-asynchronous GRPO. It adds the necessary runtime, inference, and training dispatch adapters, along with configuration validation, scripts, and unit tests. The feedback highlights a few areas for improvement: avoiding the hardcoded absolute local path for the harbor dependency in pyproject.toml to ensure portability, refactoring the fragile access to the private _managed_handle attribute in the Fireworks runtime, and safely converting PyTorch tensors to Python lists using .tolist() in the inference client to prevent type mismatches.

Comment thread pyproject.toml
Comment on lines +325 to +328
# Absolute because Ray stages this project in a temporary working directory;
# a ../harbor-private relative source would then resolve inside Ray's staging
# tree instead of to the editable checkout on this pinned single node.
harbor = { path = "/home/ray/default/harbor-private", editable = true }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Hardcoding an absolute local path (/home/ray/default/harbor-private) in pyproject.toml makes the project non-portable and will break installation for other developers or in CI/CD environments. Consider using a relative path if the dependency is always in the same parent directory, or keep the git dependency in the committed configuration and use local overrides (e.g., uv pip install -e) during development.

def inference_endpoint(self) -> FireworksInferenceEndpoint:
"""Return the native endpoint backing the managed rollout deployment."""

handle = getattr(self.service, "_managed_handle", None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing the private attribute _managed_handle of self.service is fragile as private attributes (prefixed with an underscore) are not part of the public API and can be changed or removed in future versions of the fireworks-ai SDK without notice. If a public API or property exists to retrieve the inference model and URL, please use it instead. Otherwise, consider adding a comment explaining why this private access is necessary and handle potential AttributeErrors gracefully.

Comment on lines +134 to +136
self._sample_one(
list(tokens), params=params, request_logprobs=request_logprobs
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If prompt_token_ids contains PyTorch tensors (especially on GPU), calling list(tokens) will produce a list of PyTorch scalar tensors rather than standard Python ints. This can cause type mismatches or device errors when passed to tinker.ModelInput.from_ints. It is safer to convert the tokens using .tolist() if it is a tensor, or explicitly cast the elements to integers.

                self._sample_one(
                    tokens.tolist() if hasattr(tokens, "tolist") else list(tokens),
                    params=params,
                    request_logprobs=request_logprobs,
                )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant