Repository navigation
[mxfp8 training] add new configurable params now exposed by torchao - #2251
danielvegamyhre wants to merge 1 commit into
Conversation
stack-info: PR: #2251, branch: danielvegamyhre/stack/5
cdce43e to
a071d1c
Compare
| Example: --quantize.linear.mx.mxfp8_dim0_cast_kernel_choice="torch" | ||
| """ | ||
|
|
||
| mxfp8_dim1_cast_kernel_choice: Literal["triton", "cuda", "torch"] = "triton" |
There was a problem hiding this comment.
I might have asked before but forgot -- if CUDA is recommended, why we put triton as default?
There was a problem hiding this comment.
We had triton as the default because previously using the CUDA kernels required building torchao from source. Now the CUDA kernels are shipped in the wheels, we could update the default to CUDA, actually.
stack-info: PR: #2251, branch: danielvegamyhre/stack/5
a071d1c to
84cf472
Compare
|
|
||
| @dataclass | ||
| class MXLinear: | ||
| mxfp8_dim0_cast_kernel_choice: Literal["triton", "torch"] = "torch" |
There was a problem hiding this comment.
describe why we need multiple options and when is each applicable, e.g. need to enable compile for torch, etc.
| Example: --quantize.linear.mx.mxfp8_dim0_cast_kernel_choice="torch" | ||
| """ | ||
|
|
||
| mxfp8_dim1_cast_kernel_choice: Literal["triton", "cuda", "torch"] = "triton" |
There was a problem hiding this comment.
similar.
Also, would you like to change default to cuda?
stack-info: PR: #2251, branch: danielvegamyhre/stack/5
84cf472 to
67f4155
Compare
stack-info: PR: #2251, branch: danielvegamyhre/stack/5
67f4155 to
3289e3c
Compare
| @dataclass | ||
| class MXLinear: | ||
| mxfp8_dim1_cast_kernel_choice: Literal["triton", "cuda", "torch"] = "triton" | ||
| mxfp8_dim0_cast_kernel_choice: Literal["triton", "torch"] = "triton" |
There was a problem hiding this comment.
default recipe is mxfp8_cublas for which torch kernel is recommended -- can we make the default consistent?
| Example: --quantize.linear.mx.mxfp8_dim0_cast_kernel_choice="torch" | ||
| """ | ||
|
|
||
| mxfp8_dim1_cast_kernel_choice: Literal["triton", "cuda", "torch"] = "cuda" |
There was a problem hiding this comment.
do we need to keep triton and torch? If so, when are they recommended?
| # by wrapping each submod's forward instead of their __call__ | ||
| moe = submod | ||
| for attr_name, submod in moe.named_children(): | ||
| if attr_name == "experts": |
3289e3c to
9045425
Compare
9045425 to
57646ab
Compare
57646ab to
d6c15de
Compare
stack-info: PR: #2251, branch: danielvegamyhre/stack/5
d6c15de to
e985503
Compare
|
Hi @danielvegamyhre! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Stacked PRs:
[mxfp8 training] add new configurable params now exposed by torchao
Summary
Expose job config param to control mxfp8 dim0 quantization kernel used in torchao.
torch: ~90% memory bandwidth utilization (requires torch.compile for perf)triton: ~82% memory bandwidth utilization (does not require torch.compile)Tests
(test depends on full PR stack)