-
Notifications
You must be signed in to change notification settings - Fork 224
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
[float8] all-reduce amax on dp mesh instead of global pg #933
Changes from all commits
4367e49
f1b9c1d
0e501ff
e1979e4
00b36bc
6d8e4a2
839e8aa
6cfbe7d
7365341
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ def hp_tensor_to_float8_dynamic( | |
linear_mm_config: LinearMMConfig, | ||
reduce_amax: bool = False, | ||
gemm_input_role: GemmInputRole = GemmInputRole.INPUT, | ||
device_mesh = None, | ||
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. DeviceMesh only exists in newer pytorch (2.4+). I tried to annotate device_mesh with string 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. for now, we are intending to only test float8 code on the latest nightly to move fast and minimize maintenance load. Do you know which CI is giving you issues? We have disabled CI on older PT versions per-test-file using version checks. 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. I belive it's the following one. My guess - the function signature is checked at import time. For torch==2.2.2, if one of the test imported
|
||
) -> Float8Tensor: | ||
""" | ||
Given a high precision tensor `hp_tensor`, | ||
|
@@ -52,7 +53,7 @@ def hp_tensor_to_float8_dynamic( | |
""" | ||
if tensor_already_casted_to_fp8(hp_tensor): | ||
return hp_tensor | ||
scale = tensor_to_scale(hp_tensor, float8_dtype, reduce_amax) | ||
scale = tensor_to_scale(hp_tensor, float8_dtype, reduce_amax, device_mesh) | ||
return hp_tensor_and_scale_to_float8( | ||
hp_tensor, | ||
scale, | ||
|
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.
without the PR, the unit test will throw NCCL timeout error because rank 2 and 4 did not participate in amax all-reduce