Skip to content

Ubnext #2038

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Ubnext #2038

wants to merge 10 commits into from

Conversation

nv-akorzh
Copy link

Description

Added UBnext fast Allreduce kernels into linear and layernorm_linear layer.
Falls under symmetric_ar_type with new type being 'ub_custom'

Details

Added UC MC and fast sync - low latency (lamport) allreduce kernel.

Added symmetric allocator which uses pytorch symmetric to allocate pool and suballocate from it.

As pytorch symmetric doesnt support MNNVL yet there is a fallback to use legacy UB code by creating a 11th CommOverlap object. Enabled with env NVTE_USE_UB_FOR_UBNEXT ( requires user to initialize ub by calling initialize_ub)
NVTE_UB_MAXBATCH (default 128) can increase batch size which would have enough memory for fastest kernel. If memory cant be allocated there is gradual fallback: first to UBmain in-place kernel if input could be allocated and output couldnt, and to pytorch symmetric if input couldnt be allocated.

NVTE_UB_SYMM_POOL_SIZE env overrides pool size to given number of megabytes.

nv-akorzh and others added 9 commits August 7, 2025 14:31
Signed-off-by: Anton Korzh <[email protected]>
Signed-off-by: Anton Korzh <[email protected]>
…ding zeros (NVIDIA#2019)

* for loop

Signed-off-by: Xin Yao <[email protected]>

* bulk alloc

Signed-off-by: Xin Yao <[email protected]>

* multi-tensor swizzle

Signed-off-by: Xin Yao <[email protected]>

* pad zeros in swizzle kernels

Signed-off-by: Xin Yao <[email protected]>

* unify single- and multi-tensor swizzle

Signed-off-by: Xin Yao <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix empty tensor list

Signed-off-by: Xin Yao <[email protected]>

* fix bug for col swizzle

Signed-off-by: Xin Yao <[email protected]>

* check context & fix signifiers

Signed-off-by: Xin Yao <[email protected]>

---------

Signed-off-by: Xin Yao <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Anton Korzh <[email protected]>
…kwise FP8 convert_and_update_tensor (NVIDIA#1978)

* fix input_quantizer in save_original_input bwd

Signed-off-by: Hongxiao Bai <[email protected]>

* fix get shape of blockwise tensor with only compact colwise data

Signed-off-by: Hongxiao Bai <[email protected]>

* fix blockwise FP8 convert_and_update_tensor

Signed-off-by: Hongxiao Bai <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Hongxiao Bai <[email protected]>
Co-authored-by: Tim Moon <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Anton Korzh <[email protected]>
Revert "[JAX] Disable TE Norm Custom Calls (NVIDIA#1993)"

This reverts commit 6c97061.

---------

Signed-off-by: Phuong Nguyen <[email protected]>
Signed-off-by: Anton Korzh <[email protected]>
Signed-off-by: Anton Korzh <[email protected]>
Signed-off-by: Anton Korzh <[email protected]>
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.

4 participants