Skip to content

Enable ROCm CI support.#1260

Closed
akashveramd wants to merge 29 commits intopytorch:mainfrom
akashveramd:torchtitan_rocm_support_main
Closed

Enable ROCm CI support.#1260
akashveramd wants to merge 29 commits intopytorch:mainfrom
akashveramd:torchtitan_rocm_support_main

Conversation

@akashveramd
Copy link
Copy Markdown
Collaborator

@akashveramd akashveramd commented Jun 4, 2025

In this PR-

  • Added support for creating ROCm docker image for torchtian and running torchtitan tests on ROCm.
  • Added ROCm CI support for integration_test unit test.

@facebook-github-bot
Copy link
Copy Markdown

Hi @akashveramd!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@akashveramd akashveramd changed the title Added support to run torchtitan tests on ROCm. Added support for creating ROCm docker image for torchtian & run torchtitan tests on ROCm. Jun 4, 2025
@akashveramd akashveramd marked this pull request as draft June 4, 2025 05:45
@facebook-github-bot
Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 5, 2025
@akashveramd akashveramd changed the title Added support for creating ROCm docker image for torchtian & run torchtitan tests on ROCm. Added support for creating ROCm docker image for torchtitan & run torchtitan tests on ROCm. Jun 12, 2025
@akashveramd akashveramd changed the title Added support for creating ROCm docker image for torchtitan & run torchtitan tests on ROCm. Add support for creating ROCm docker image for torchtitan & run torchtitan tests on ROCm. Jun 12, 2025
@akashveramd akashveramd force-pushed the torchtitan_rocm_support_main branch from ebaafdc to ce60b15 Compare June 12, 2025 07:32
@akashveramd akashveramd changed the title Add support for creating ROCm docker image for torchtitan & run torchtitan tests on ROCm. Add support for creating ROCm docker image for torchtitan & enable ROCm CI support. Jun 13, 2025
Comment thread .github/workflows/docker-builds.yml Outdated
Comment thread tests/integration_tests.py Outdated
Comment thread tests/integration_tests.py Outdated
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Jun 24, 2025

No ciflow labels are configured for this repo.
For information on how to enable CIFlow bot see this wiki

Comment thread .ci/docker/build.sh
Comment thread .ci/docker/ubuntu-rocm/Dockerfile Outdated
Comment thread .ci/docker/build.sh
Comment thread .ci/docker/build.sh Outdated
Comment thread .github/workflows/docker-builds.yml Outdated
Comment thread tests/integration_tests/features.py
Comment thread tests/integration_tests.py Outdated
Comment thread tests/integration_tests.py Outdated
Comment thread tests/integration_tests.py Outdated
TEST_WITH_ROCM
and test_flavor.test_name in skip_for_rocm_test_list
):
continue
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.

This logic makes sense to me, but if we really want to use the test setting in integration_tests_h100.py, we should move this logic to that file (and of course rename it to be more agnostic).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@jithunnair-amd : All tests in integration_tests_h100.py passes for rocm. Hence, we don't TEST_WITH_ROCM in integration_tests_h100.py. However, we need to talk about renaming integration_tests_h100.py filename as we also run it on rocm runners.
cc: @tianyu-l @fegin

Comment thread .github/workflows/integration_test_8gpu_rocm.yaml Outdated
@akashveramd akashveramd changed the title Add support for creating ROCm docker image for torchtitan & enable ROCm CI support. Enable ROCm CI support. Jun 25, 2025
@akashveramd akashveramd force-pushed the torchtitan_rocm_support_main branch from d527f27 to 18025ad Compare July 3, 2025 05:15
@jithunnair-amd
Copy link
Copy Markdown
Contributor

@huydhn Need your help in creating a new docker repo for torchtitan ROCm docker image: https://github.com/pytorch/torchtitan/actions/runs/16042425274/job/45266420732?pr=1260#step:7:1436

name unknown: The repository with name 'torchtitan/torchtitan-rocm-ubuntu-22.04-clang12' does not exist in the registry with id '308535385114'

@akashveramd akashveramd force-pushed the torchtitan_rocm_support_main branch from 4e81fd9 to c23e65b Compare September 26, 2025 04:53
@akashveramd
Copy link
Copy Markdown
Collaborator Author

@fegin @tianyu-l @huydhn: The aws setup fails in integration_test_8gpu.yaml workflow file. Can we get help for granting this role arn:aws:iam::308535385114:role/gha_workflow_s3_and_ecr_read_only for torchtitan?

@huydhn
Copy link
Copy Markdown
Contributor

huydhn commented Oct 2, 2025

From what I see torchtitan should already have permission to that role:

name = "gha_workflow_s3_and_ecr_read_only"

max_session_duration = 18000
description = "Allows github actions running on PyTorch to have read only access to ECR and s3://gha-artifacts/ bucket"
assume_role_policy = jsonencode({
  Version = "2012-10-17"
  Statement = [
    {
      Effect = "Allow"
      Principal = {
        Federated = "arn:aws:iam::308535385114:oidc-provider/token.actions.githubusercontent.com"
      }
      Action = "sts:AssumeRoleWithWebIdentity"
      Condition = {
        StringEquals = {
          "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
        }
        "ForAnyValue:StringLike" = {
          "token.actions.githubusercontent.com:sub" = [
            "repo:pytorch/ao:*",
            "repo:pytorch/pytorch:*",
            "repo:pytorch/test-infra:*",
            "repo:pytorch/torchtitan:*", <-- This one
          ]
        }
      }
    }
  ]
})

I suspect that the error happens because your PR is a forked PR from https://github.com/akashveramd/torchtitan, not https://github.com/pytorch/torchtitan. So, I'm trying to test that out in #1782. If this is the case, we need to implement ciflow/rocm in torchtitan to address this issue, same as the rocm workflow in PyTorch https://github.com/pytorch/pytorch/blob/main/.github/workflows/rocm.yml#L9

@huydhn
Copy link
Copy Markdown
Contributor

huydhn commented Oct 2, 2025

It is confirmed https://github.com/pytorch/torchtitan/actions/runs/18179897492/job/51753630586?pr=1782 that authentication works on a non-forked PR. This makes sense because the grant is only to pytorch/torchtitan, so we will need ciflow/rocm and a separate workflow for rocm here unfortunately

@akashveramd
Copy link
Copy Markdown
Collaborator Author

Closing in favor of PR: #1786

tianyu-l pushed a commit that referenced this pull request Oct 30, 2025
This PR is based out of the original PR
#1260.
The original PR was created in a different fork, and it was having
issues setting up aws inside the workflow. Since the workflow was
running from a forked PR.

---------

Co-authored-by: Huy Do <huydhn@gmail.com>
jquesnelle pushed a commit to NousResearch/torchtitan that referenced this pull request Nov 10, 2025
This PR is based out of the original PR
pytorch#1260.
The original PR was created in a different fork, and it was having
issues setting up aws inside the workflow. Since the workflow was
running from a forked PR.

---------

Co-authored-by: Huy Do <huydhn@gmail.com>
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 13, 2026
This PR is based out of the original PR
pytorch#1260.
The original PR was created in a different fork, and it was having
issues setting up aws inside the workflow. Since the workflow was
running from a forked PR.

---------

Co-authored-by: Huy Do <huydhn@gmail.com>
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 25, 2026
This PR is based out of the original PR
pytorch#1260.
The original PR was created in a different fork, and it was having
issues setting up aws inside the workflow. Since the workflow was
running from a forked PR.

---------

Co-authored-by: Huy Do <huydhn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm CLA Signed This label is managed by the Meta Open Source bot. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants