-
Notifications
You must be signed in to change notification settings - Fork 293
[float8 moe training] Add TP support #2425
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2425
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New FailuresAs of commit 29be4b2 with merge base 2898903 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Error with FSDP=2, TP=2 targeting both routed experts AND shared expert. The issue is specific to the shared expert using 2D parallelism. Will debug and resolve in separate PR. The logs are a bit confusing, I first see an error in meta registration that "B" tensor is fp32 instead of bf16. This is odd, since I'm not using
Then a few lines later, I see my log lines during the forward pass, just before the grouped mm, confirming the "B" tensor (W1) is bf16, not fp32:
(as an aside, it's strange these log lines appear AFTER the error has already occured (?). I assume it must be due to how log writes are buffered) Then at the end of the logs, I see a different error related to strides/sizes not matching a storage of size 0, but i'm guessing this a downstream affect of the first error:
Full logs: https://www.internalfb.com/phabricator/paste/view/P1850071143 |
80cf6d4
to
44778d0
Compare
44778d0
to
accbb27
Compare
c61add8
to
976bc10
Compare
e4ff51d
to
074b423
Compare
fyi @tianyu-l @lessw2020 @ngimel for awareness as well |
074b423
to
fb0122e
Compare
97e55e8
to
29be4b2
Compare
from torch.nn import functional as F | ||
|
||
# this feature requires CUDA and SM89+ | ||
if not torch.cuda.is_available() or torch.cuda.get_device_capability() < (8, 9): |
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.
nit we have some helpers for this in ao/utils
|
||
# this test requires torchtitan | ||
try: | ||
from torchtitan.experiments.llama4.infra.parallelize import apply_moe_tp |
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.
we should add this test to test_float8 ->
ao/.github/workflows/float8_test.yml
Line 46 in 994a4ba
script: | |
dist.destroy_process_group() | ||
|
||
|
||
def _validate_model_conversion( |
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.
did I review another PR that had teh same util? if so maybe put into torchao.testing so we can reuse
return device_mesh | ||
|
||
|
||
def apply_moe_tp( |
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.
this is always specific to module structure e.g. the fqn's right?
@@ -8,6 +14,8 @@ | |||
register_quantize_module_handler, | |||
) | |||
|
|||
logger: logging.Logger = logging.getLogger(__name__) |
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.
side note, we should setup better logging in torchao
alas: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
just getting the root logger going w/ null handler
Note: this should be merged AFTER this bug fix: #2451 I will rebase and retest all of this once that's merged.
Summary
offs
optional to handle shared_expert case where num_experts=1 (scaled grouped GEMM only processing 1 expert)Test plan
Limitations