Skip to content

Add AMD ROCm Docker image and Tinker training examples#1892

Open
eddierichter-amd wants to merge 7 commits into
NovaSky-AI:mainfrom
eddierichter-amd:amd
Open

Add AMD ROCm Docker image and Tinker training examples#1892
eddierichter-amd wants to merge 7 commits into
NovaSky-AI:mainfrom
eddierichter-amd:amd

Conversation

@eddierichter-amd

Copy link
Copy Markdown

This PR adds an AMD ROCm path for running SkyRL’s Tinker-compatible API with FSDP training and vLLM ROCm inference.

Changes

  • Add docker/Dockerfile.amd for a ROCm-based SkyRL image.
  • Add docker/pyproject.amd.toml to avoid CUDA-specific dependencies in the AMD image.
  • Add examples/train/amd/run_tinker_server_amd.sh to launch the Tinker API on AMD nodes.
  • Add AMD example clients:
    • tinker_hello_world.py: small LoRA smoke test.
    • grpo_client.py: GSM8K GRPO/PPO training example.
  • Add examples/train/amd/README.md with build/run instructions.

@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 AMD ROCm support for SkyRL's Tinker-compatible API, adding a dedicated Dockerfile, pyproject configuration, and example scripts for running a Tinker server and GRPO/smoke clients on AMD GPUs. However, several critical issues were identified in the changes: removing LayerwiseReloadWorkerMixin from NewInferenceWorkerWrap will break weight updates, and defining finish_weight_update directly risks collisions with newer vLLM versions. Additionally, non-existent package versions are specified for boto3, s3transfer, and transformers, and an unsupported --active flag is passed to uv run in the server startup script.

Comment thread skyrl/backends/skyrl_train/inference_servers/new_inference_worker_wrap.py Outdated
Comment thread skyrl/backends/skyrl_train/inference_servers/new_inference_worker_wrap.py Outdated
Comment thread docker/Dockerfile.amd Outdated
Comment thread docker/pyproject.amd.toml
Comment thread examples/train/amd/run_tinker_server_amd.sh
Comment on lines +172 to +186
_empty_cuda_cache()

def skyrl_finish_weight_update(self) -> None:
"""
Finalize the current weight update.

For checkpoint-format weights, runs layerwise postprocessing
(quantization repacking, attention weight processing, etc.).
Must be called after all update_weights_* calls are done.

Keep the SkyRL-prefixed name to avoid colliding with vLLM Worker
methods such as finish_weight_update.
"""
super().skyrl_finish_weight_update()
_empty_cuda_cache()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you make this modification directly in LayerwiseReloadWorkerMixin itself?

Comment on lines +36 to +39
def _empty_cuda_cache() -> None:
"""Release unused CUDA/ROCm cached blocks after full-weight sync."""
if not torch.cuda.is_available():
return

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
def _empty_cuda_cache() -> None:
"""Release unused CUDA/ROCm cached blocks after full-weight sync."""
if not torch.cuda.is_available():
return
def _empty_cuda_cache_rocm() -> None:
"""Release unused ROCm cached blocks after full-weight sync."""
is_rocm = torch.version.hip is not None
if not torch.cuda.is_available() or not is_rocm:
return

Since this is only needed for RoCm, it would be good to add this guard.

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.

2 participants