Skip to content

Sync TransformerEngine-FL to upstream v2.17 - #105

Open
Caozhou1995 wants to merge 4 commits into
flagos-ai:mainfrom
Caozhou1995:sync/upstream-v2.17-squashed
Open

Sync TransformerEngine-FL to upstream v2.17#105
Caozhou1995 wants to merge 4 commits into
flagos-ai:mainfrom
Caozhou1995:sync/upstream-v2.17-squashed

Conversation

@Caozhou1995

Copy link
Copy Markdown
Collaborator

Integrates upstream NVIDIA/TransformerEngine v2.17 (commit 2e559f0) into flagos-ai/TransformerEngine-FL:main, preserving all multi-backend plugin work.

  • Upstream v2.14 -> v2.17 integration (EP, MXFP8/NVFP4, fused router/MLP)
  • 25 conflict files resolved, fork patches preserved (torch_nv, te_device_type, OpManager dispatcher, 9-backend CI/CD)
  • P0: removed 2 deleted C++ bindings (convert_host_pointers_to_tensor, get_device_pointer_for_data_and_scales) from plugin + 6 vendors
  • Enum sync: DType assert ==->subset, NVTE_QKV_Format/Layout members
  • Device abstraction re-injected (quantized_tensor.py make_empty etc.)
  • Includes [CICD] Add KunlunXin unit and MCore integration test support #94 KunlunXin CICD support

Description

Please include a brief summary of the changes, relevant motivation and context.

Fixes # (issue)

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Integrates upstream NVIDIA/TransformerEngine v2.17 (commit 2e559f0) into
flagos-ai/TransformerEngine-FL:main, preserving all multi-backend plugin work.

- Upstream v2.14 -> v2.17 integration (EP, MXFP8/NVFP4, fused router/MLP)
- 25 conflict files resolved, fork patches preserved (torch_nv, te_device_type,
  OpManager dispatcher, 9-backend CI/CD)
- P0: removed 2 deleted C++ bindings (convert_host_pointers_to_tensor,
  get_device_pointer_for_data_and_scales) from plugin + 6 vendors
- Enum sync: DType assert ==->subset, NVTE_QKV_Format/Layout members
- Device abstraction re-injected (quantized_tensor.py make_empty etc.)
- Includes flagos-ai#94 KunlunXin CICD support
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


flagscale-agent seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

flagscale-agent added 3 commits August 11, 2026 12:18
- Added 15 new v2.17 bindings: splits_to_offsets_multi, copy_data_ptrs_to_device,
  bulk_allocate, create_empty_quantized_tensor, group_dequantize,
  multi_tensor_pad_last_dim, multi_tensor_swizzle_scales_for_gemm_,
  multi_tensor_transpose_to_bhsd, cusolvermp_ctx_create/destroy, newton_schulz,
  nvfp4_quantize_with_amax, nvfp4_group_quantize_with_amax,
  swizzle_scales_and_pack_ptrs_for_discrete_weights,
  get_grouped_gemm_setup_workspace_size
- Added new params: tensor_offsets (group_quantize/bgrad_group_quantize/nvfp4_group_quantize_with_amax),
  glu_linear_offset (clamped_swiglu/clamped_dswiglu)
- Removed dead bindings deleted in upstream v2.17 PR#3001:
  convert_host_pointers_to_tensor, get_device_pointer_for_data_and_scales
… signatures

- register_ops.py: register get_grouped_gemm_setup_workspace_size (defined in
  cuda.py but missing from registry) and create_empty_quantized_tensor
- cuda.py: fix get_grouped_gemm_setup_workspace_size stale signature (add
  num_tensors param per upstream gemm.py); fix swap_first_dims to pass out as
  keyword-only arg matching the C++ binding
- ops.py + vendor backends (enflame/hygon/iluvatar/metax/musa): sync fused
  attention fwd/bwd signatures with v2.17 new params (o_format,
  qkv_scale_inv_format, do_format, dqkv_layout, do_scale_inv_format)

Fixes runtime AttributeError / arg-count errors surfaced by L0/L1 CUDA unit
tests (test_fusible_ops, distributed test_numerics).
- ops.py: add NVTERoutingMapFormat enum (BYTEMAP=0, BITMAP_U8=1) mirroring
  the C++ pybind enum, bind it in the tex proxy and __dir__ so
  transformer_engine.pytorch.router can re-export it
- cuda.py: align 4 CUDABackend fused-router signatures with upstream v2.17
  pybind: append routing_map_format to topk_fwd/bwd and aux_loss_fwd;
  drop stale num_tokens/num_experts from topk_bwd and aux_loss_bwd

Fixes router import (AttributeError) and 891 test_fused_router failures;
now 933 passed / 120 skipped / 0 failed.
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