-
Notifications
You must be signed in to change notification settings - Fork 632
Implement ciflow/rocm on Torchtitan #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akashveramd
wants to merge
26
commits into
main
Choose a base branch
from
av_implement_ciflow_rocm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+90
−27
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0539dbe
Implement ciflow/rocm.
akashveramd 19a5a15
Removed tracking_issue & ciflow_tracking_issue.
akashveramd a2a55a7
Removed ciflow/rocm tag.
akashveramd cc29b39
Added condition to run ROCm workflow when label is added.
akashveramd 4485cd1
Moved dynamic matrix creation to a separate reusable workflow. Added …
akashveramd 132a3eb
Using set instead of write in set-matrix.
akashveramd 75a1d53
Removed trailing slash from 'ciflow/8gpu' label.
akashveramd 8f8d9df
Refactored set-matrix.yaml. Added option to create ROCm matrix for pu…
akashveramd 9417b90
Fixed indentation and Lint in set-matrix.yaml.
akashveramd 924444d
Fixed indentation in set-matrix.yaml.
akashveramd e2b8f12
Run ROCm workflow only when PR label added.
akashveramd db8cb50
Changed the name to TRIGGERED_8GPU_LABEL. Setting default value for T…
akashveramd c07b45d
Minor comment change.
akashveramd a53e303
re-ordered if conditions in set-matrix.yaml.
akashveramd b5d35a4
Dummy commit
akashveramd 1b429ca
Separated condition for PR label trigger in set-matrix.yaml.
akashveramd 878e01b
DEBUG:rolled back original if conditions in set-matrix.yaml and added…
akashveramd b001e4f
Dummy commit
akashveramd 17e7fd5
DEBUG: Using 4 GPU ROCm runner.
akashveramd e54daee
Dummy commit
akashveramd 255ab3d
Using 8 GPU ROCm runner.
akashveramd ffd1da3
Corrected indentation in labeler.yml. Removed debug statements from s…
akashveramd c6822c9
Corrected indentation in pytorch-probot.yml.
akashveramd 4fd8306
Simplify pull_request trigger
huydhn 158571f
Don't run both CUDA and ROCm job when ciflow/8gpu is there
huydhn a2f63ab
Remove HAS_8GPU_LABEL
huydhn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| "ciflow/8gpu": | ||
| - .ci/docker/** | ||
| - .github/workflows/** | ||
| - scripts/** | ||
| - tests/** | ||
| - torchtitan/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ciflow_push_tags: | ||
| - ciflow/8gpu | ||
| labeler_config: labeler.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Set Matrix | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| matrix: | ||
| description: dynamically set matrix | ||
| value: ${{ jobs.set.outputs.matrix }} | ||
|
|
||
| jobs: | ||
| set: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set.outputs.matrix }} | ||
| env: | ||
| # Event flags evaluated by github actions before the step runs: | ||
| IS_MAIN_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
| IS_SCHEDULE: ${{ github.event_name == 'schedule' }} | ||
| IS_PR: ${{ github.event_name == 'pull_request' }} | ||
| IS_8GPU_TAG: ${{ startsWith(github.ref, 'refs/tags/ciflow/8gpu/') }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this, if we already have the one above?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tags and labels are independent and different events. Hence, created a separate variable for it. |
||
| TRIGGERED_8GPU_LABEL: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' }} | ||
|
|
||
| steps: | ||
| - id: set | ||
| run: | | ||
| # Define ROCm matrix | ||
| ROCM_MATRIX='{ | ||
| "name": "rocm", | ||
| "runner": "linux.rocm.gpu.gfx942.8", | ||
| "gpu-arch-type": "rocm", | ||
| "gpu-arch-version": "7.0", | ||
| "docker-image": "torchtitan-rocm-ubuntu-22.04-clang12", | ||
| "index-url": "https://download.pytorch.org/whl/nightly/rocm7.0" | ||
| }' | ||
|
|
||
| # Define CUDA matrix | ||
| CUDA_MATRIX='{ | ||
| "name": "cuda", | ||
| "runner": "linux.g5.48xlarge.nvidia.gpu", | ||
| "gpu-arch-type": "cuda", | ||
| "gpu-arch-version": "12.6", | ||
| "docker-image": "torchtitan-ubuntu-20.04-clang12", | ||
| "index-url": "https://download.pytorch.org/whl/nightly/cu126" | ||
| }' | ||
|
|
||
| # Use default value as 'false' for unset environment variables | ||
| IS_MAIN_PUSH="${IS_MAIN_PUSH:-false}" | ||
| IS_SCHEDULE="${IS_SCHEDULE:-false}" | ||
| IS_PR="${IS_PR:-false}" | ||
| IS_8GPU_TAG="${IS_8GPU_TAG:-false}" | ||
| TRIGGERED_8GPU_LABEL="${TRIGGERED_8GPU_LABEL:-false}" | ||
|
|
||
| # Decide which matrix entries to include based on event type | ||
| # Runs ROCm only for push tag OR when PR label gets triggered | ||
| if [[ "$IS_8GPU_TAG" == "true" || "$TRIGGERED_8GPU_LABEL" == "true" ]]; then | ||
| cat > matrix.json <<JSON | ||
| {"include": [$ROCM_MATRIX]} | ||
| JSON | ||
|
|
||
| # Runs CUDA and ROCm for normal PR (if PR label is present) OR for push to main, cron schedule | ||
| elif [[ ("$IS_MAIN_PUSH" == "true" || "$IS_SCHEDULE" == "true") ]]; then | ||
| cat > matrix.json <<JSON | ||
| {"include": [$CUDA_MATRIX,$ROCM_MATRIX]} | ||
| JSON | ||
|
|
||
| # Runs CUDA only as default (includes normal PR, if PR label is NOT present) | ||
| else | ||
| cat > matrix.json <<JSON | ||
| {"include": [$CUDA_MATRIX]} | ||
| JSON | ||
| fi | ||
|
|
||
| # Export matrix to job outputs | ||
| { | ||
| echo 'matrix<<EOF' | ||
| cat matrix.json | ||
| echo 'EOF' | ||
| } >> $GITHUB_OUTPUT | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for -- why do we need both
pull_requestandtags?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my understanding the PR workflows and tag workflows are totally independent. Tags provides CI flow, meaning tags can be pushed to trigger CI runs on specific commits even after the PR is closed. They can also be used for versioning releases.
pull_request are used to run workflows when the PR is open.