Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/_run-ci-rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,6 @@ jobs:
git fetch origin "$MEGATRON_PR"
git checkout -f FETCH_HEAD
git log --oneline -1
if git apply --check "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"; then
git apply "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"
elif git apply --reverse --check "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"; then
echo "Megatron ROCm patch already present"
else
echo "::error::Selected Megatron ref is incompatible with the ROCm patch"
exit 1
fi
pip install -e . --no-deps --break-system-packages
fi
cd $GITHUB_WORKSPACE && pip install -e . --no-deps --break-system-packages
Expand Down
2 changes: 0 additions & 2 deletions docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ ENV CMAKE_PREFIX_PATH=/opt/rocm:/opt/rocm/hip:/usr/local:/usr

# Patches + requirements consumed below.
# TODO: remove these patches once the changes are merged into the main codebase.
COPY docker/amd_patch/latest/megatron.patch /tmp/amd_patch/megatron.patch
COPY docker/amd_patch/latest/tile_kernels.patch /tmp/amd_patch/tile_kernels.patch
COPY docker/amd_patch/latest/tilelang_hip_fp8.patch /tmp/amd_patch/tilelang_hip_fp8.patch
COPY requirements.txt /tmp/requirements.txt
Expand Down Expand Up @@ -120,7 +119,6 @@ RUN pip install --no-deps tile_kernels==1.0.0 && \
RUN rm -rf /root/Megatron-LM && \
git clone --recursive -b ${MEGATRON_BRANCH} https://github.com/${MEGATRON_REPO}.git /root/Megatron-LM && \
cd /root/Megatron-LM && \
git apply /tmp/amd_patch/megatron.patch && \
pip install -e .

RUN cd /sgl-workspace/sglang && \
Expand Down
20 changes: 0 additions & 20 deletions docker/amd_patch/latest/megatron.patch

This file was deleted.

13 changes: 3 additions & 10 deletions tests/ci/test/test_run_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,22 +522,15 @@ def test_stage_consumes_policy_and_preserves_manual_full_scope(self):
assert "allow-unsafe-pr-checkout" not in reusable
assert "MILES_HARDWARE_PLATFORM: rocm" in reusable

def test_megatron_override_preserves_rocm_patch(self):
def test_megatron_override_installs_the_checked_out_ref_unpatched(self):
reusable = (Path(__file__).resolve().parents[3] / ".github" / "workflows" / "_run-ci-rocm.yml").read_text()
override = reusable.split('if [ -n "$MEGATRON_PR" ]; then', 1)[1].split(" cd $GITHUB_WORKSPACE", 1)[0]

checkout = override.index("git checkout -f FETCH_HEAD")
check_patch = override.index('git apply --check "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"')
apply_patch = override.index('git apply "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"')
reverse_check = override.index(
'elif git apply --reverse --check "$GITHUB_WORKSPACE/docker/amd_patch/latest/megatron.patch"; then'
)
error = override.index('echo "::error::Selected Megatron ref is incompatible with the ROCm patch"')
fail = override.index("exit 1")
install = override.index("pip install -e . --no-deps --break-system-packages")

assert checkout < check_patch < apply_patch < reverse_check < error < fail < install
assert "/tmp/amd_patch/megatron.patch" not in override
assert checkout < install
assert "amd_patch" not in override


# --- CLI seam: local nightly alias and invalid-suite exit behavior -----------
Expand Down