Repository navigation
[FT] Add torchft to CI - #1398
Conversation
d577a46 to
19593e2
Compare
|
cc @wwwjn who's considering refactor tests in torchtitan |
b3ddb1a to
b8102b1
Compare
|
TorchFT CI has PHB connections: hitting this error on comms: |
fc623e8 to
26d655f
Compare
| if args.ngpu < 8: | ||
| logger.info("Skipping TorchFT integration tests as we need 8 GPUs.") |
There was a problem hiding this comment.
allow arbitrary number gpu's so we can also run this test locally? i guess we just need to pass the ngpu to run_tests and create the list of ranks based on ngpu arg instead of 8?
There was a problem hiding this comment.
yeah I dont like how its hard-coded right now. But on the flip-side integration tests are only meant to be used on one machine and so all the integration tests and our CI assume 8 GPUs.
There was a problem hiding this comment.
we can still ensure it's run on a single machine right? plus we can also use less than the number of gpu's on the machine on the ci e.g. run locally or set up a different config on the ci. don't have a strong pref, we can also come back to this later when needed
| cmds = [] | ||
|
|
||
| for replica_id, ranks in enumerate(all_ranks): | ||
| cmd = ( |
There was a problem hiding this comment.
nit: make this a list and join later
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'torchtitan/components/ft.py' |
There was a problem hiding this comment.
Does this mean you are ok if train.py / something else break FT integration.
btw the test won't be triggered for this PR if you specify this way.
There was a problem hiding this comment.
yeah might be good to run this on all diffs to make sure some unrelated changes don't break the ft integration (this is an integration test anyway)
There was a problem hiding this comment.
Yeah the tests aren't triggered for this PR, but previously I did try it out by changing ft.py and the CI did pass.
yeah might be good to run this on all diffs
Yeah this is up to us to decide and how much we would want torchft changes to potentially block titan CI. Considering FT is not a hard dependency for titan, i took a pretty conservative approach. Also the test doesn't actually test multiple replica groups in CI yet due to the issue mentioned in the description so the tests are still basic.
There was a problem hiding this comment.
we can add more to the tests later but i feel we should consider ft as a hard dependency because if we don't, things can break for people who use titan with ft e.g. i remember pipeline parallel working with ft before but started seeing some issues around backward pass called multiple times. might be good to catch these issues in diffs. (we should probably also run titan test in torchft probably)
don't have a strong pref for now though, we can change things later. may be a broader discussion on how to approach ft integrations, we may integrate with more than just titan
tianyu-l
left a comment
There was a problem hiding this comment.
stamp to unblock -- I think we still have the regular per 6 hour tests running, so if CI is broken, you can get notified and help fix. Hope it's not too much for now. If it's becoming a headache, we can revisit.
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: pytorch#907 This sets up CI for torchft in torchtitan, it only runs when `torchtitan/components/ft.py` is changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling: `python tests/integration_tests_ft.py --test_id ...` TODO: - There is an issue with our CI where we cannot set `CUDA_VISIBLE_DEVICES` to partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?
based off of @fegin previous PR: #907
This sets up CI for torchft in torchtitan, it only runs when
torchtitan/components/ft.pyis changed, but we can expand it as necessary. This also makes it easier to run torchft tests / configs by just calling:python tests/integration_tests_ft.py --test_id ...TODO:
CUDA_VISIBLE_DEVICESto partition the devices per replica group (I get error Cuda failure 217 'peer access is not supported between these two devices'), as a result this PR only runs with 1 replica group. In follow up PRs need to look into manually setting the cuda device when using torchft?