Skip to content
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

Update DORT to follow PyTorch changes #16394

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Update DORT to follow PyTorch changes #16394

merged 2 commits into from
Jun 20, 2023

Conversation

wschin
Copy link
Contributor

@wschin wschin commented Jun 17, 2023

Fix #16355. The root cause change in PyTorch is #103302, which seem blocking calling make_fx inside a dynamo backend.

Changes:

  1. Move decomposition to register_backend.py, so we don't have to call make_fx inside DORT, which triggers a bunch of new exceptions.
  2. Remove shape inference based on FakeTensorProp since the FX graph received from dynamo contains all shapes now.
  3. Fix a macro bug so that DORT can build without CUDA.

Before (3),

#if defined(USE_CUDA) || defined(USE_ROCM)
  virtual PhiloxGenerator& PhiloxGenerator__Default() = 0;
#ifdef ENABLE_TRAINING_TORCH_INTEROP
...
#endif
#endif

After (3),

#if defined(USE_CUDA) || defined(USE_ROCM)
  virtual PhiloxGenerator& PhiloxGenerator__Default() = 0;
#endif
#ifdef ENABLE_TRAINING_TORCH_INTEROP
...
#endif

The later one looks better since the ENABLE_TRAINING_TORCH_INTEROP is for Python bridge code, not for random-number-generating kernels PhiloxGenerator.

Add one line back
@askhade
Copy link
Contributor

askhade commented Jun 19, 2023

Please update the PR description to explain the fix. It will help to review the code as I am not familiar with the code under torchdynamo dir.

@wschin
Copy link
Contributor Author

wschin commented Jun 19, 2023

Please update the PR description to explain the fix. It will help to review the code as I am not familiar with the code under torchdynamo dir.

Sure. It's done now.

@wschin wschin added the merge at green This PR can be merged when the CI is green. Please merge. label Jun 19, 2023
@wschin wschin self-assigned this Jun 19, 2023
@wschin wschin merged commit c8de3ea into main Jun 20, 2023
89 of 91 checks passed
@wschin wschin deleted the wechi/fix-dort branch June 20, 2023 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge at green This PR can be merged when the CI is green. Please merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Training] DORT fails with new PyTorch changes
2 participants