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

Attempt to use rFactor for allreduce #3543

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Attempt to use rFactor for allreduce #3543

wants to merge 20 commits into from

Conversation

wujingyue
Copy link
Collaborator

mpirun -np 1 -x NVFUSER_DUMP=fusion_ir_preseg pytest tests/python/test_communication.py -k allreduce_rfactor -s --only-mpi
%kernel {
T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0})
   = reduction( T0_g_float[iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3}] (DeviceMesh{0}), op = add, initial value = float(0), allreduce = false )
T1_g_float[iS15{2}, rS16{1}, iS17{3}] (DeviceMesh{0})
   = reduction( T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0}), op = add, initial value = float(0), allreduce = false )

TransformPrinter :
T0_g_float[iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3}] (DeviceMesh{0})
 logical domain : (iS0{2}, iS1{5}, iS2{3})
 allocation domain : (iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3})
 contiguity: t t t t
  Outer split: iS1{5} by factor 1 -> ideviceIdx.x6{1}, iS7{5}
 loop domain : (iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3})
T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0})
 root domain : (iS10{2}, rS11{5}rf, iS12{3})
  Outer split: rS11{5}rf by factor 1 -> ideviceIdx.x13{1}rf, rS14{5}rf
 logical domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
 allocation domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
 contiguity: t t n t
 loop domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
T1_g_float[iS15{2}, rS16{1}, iS17{3}] (DeviceMesh{0})
 logical domain : (iS15{2}, rS16{1}, iS17{3})
 allocation domain : (iS15{2}, rS16{1}, iS17{3})
 contiguity: t n t
 loop domain : (iS15{2}, rS16{1}, iS17{3})
} // %kernel
RuntimeError:  INTERNAL ASSERT FAILED at "/opt/pytorch/nvfuser/csrc/scheduler/vectorize_helper.cpp":1063, please report a bug with repro script to NVFuser at https://github.com/NVIDIA/Fuser/issues. Unexpected producer RF ID: iS2{3}
Exception raised from getVectorizationBreakPointOfReductionProducer at /opt/pytorch/nvfuser/csrc/scheduler/vectorize_helper.cpp:1063 (most recent call first):

```
mpirun -np 1 -x NVFUSER_DUMP=fusion_ir_preseg pytest tests/python/test_communication.py -k allreduce_rfactor -s --only-mpi
```

```
%kernel {
T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0})
   = reduction( T0_g_float[iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3}] (DeviceMesh{0}), op = add, initial value = float(0), allreduce = false )
T1_g_float[iS15{2}, rS16{1}, iS17{3}] (DeviceMesh{0})
   = reduction( T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0}), op = add, initial value = float(0), allreduce = false )

TransformPrinter :
T0_g_float[iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3}] (DeviceMesh{0})
 logical domain : (iS0{2}, iS1{5}, iS2{3})
 allocation domain : (iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3})
 contiguity: t t t t
  Outer split: iS1{5} by factor 1 -> ideviceIdx.x6{1}, iS7{5}
 loop domain : (iS0{2}, ideviceIdx.x6{1}, iS7{5}, iS2{3})
T2_l_float[iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3}] (DeviceMesh{0})
 root domain : (iS10{2}, rS11{5}rf, iS12{3})
  Outer split: rS11{5}rf by factor 1 -> ideviceIdx.x13{1}rf, rS14{5}rf
 logical domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
 allocation domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
 contiguity: t t n t
 loop domain : (iS10{2}, ideviceIdx.x13{1}rf, rS14{5}rf, iS12{3})
T1_g_float[iS15{2}, rS16{1}, iS17{3}] (DeviceMesh{0})
 logical domain : (iS15{2}, rS16{1}, iS17{3})
 allocation domain : (iS15{2}, rS16{1}, iS17{3})
 contiguity: t n t
 loop domain : (iS15{2}, rS16{1}, iS17{3})
} // %kernel
```

```
RuntimeError:  INTERNAL ASSERT FAILED at "/opt/pytorch/nvfuser/csrc/scheduler/vectorize_helper.cpp":1063, please report a bug with repro script to NVFuser at https://github.com/NVIDIA/Fuser/issues. Unexpected producer RF ID: iS2{3}
Exception raised from getVectorizationBreakPointOfReductionProducer at /opt/pytorch/nvfuser/csrc/scheduler/vectorize_helper.cpp:1063 (most recent call first):
```
@naoyam
Copy link
Collaborator

naoyam commented Dec 10, 2024

What does the actual fusion that is passed to the reduction scheduler look like?

@wujingyue wujingyue force-pushed the wjy/rs branch 2 times, most recently from 6d03163 to 66a3363 Compare December 10, 2024 15:56
Base automatically changed from wjy/rs to main December 11, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants