Sync upstream v2.17 to main - #100
Closed
Caozhou1995 wants to merge 20 commits into
Closed
Conversation
|
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. |
Caozhou1995
force-pushed
the
sync-upstream-v2.17
branch
from
August 10, 2026 04:03
fe32cde to
d29093a
Compare
added 6 commits
August 10, 2026 04:14
Resolved all 229 conflicts across P0/P1/P2 priorities: P0 (plugin system): No conflicts - fork's plugin/ directory fully preserved P1 (4 files): Manual merge preserving fork features + upstream additions 1. setup.py: Fork plugin build system + upstream NCCL EP support 2. transformer_engine/__init__.py: Fork plugin patches + upstream NCCL EP version check 3. transformer_engine/common/__init__.py: Fork skip_cuda_build() + plugin import 4. transformer_engine/pytorch/__init__.py: Fork torch_nv + upstream tensor/context utilities P2 (224 files): Accepted upstream version for core library files Upgrade path: v2.14 -> v2.17
- convert_host_pointers_to_tensor - get_device_pointer_for_data_and_scales These bindings were missing in upstream v2.17's pybind.cpp despite the corresponding C++ implementations existing in utils.cpp.
Applied 18 patches across 6 files to replace hardcoded 'cuda' device strings with TE_DEVICE_TYPE constant for multi-backend support. Changes: - utils.py: 4 patches - distributed.py: 3 patches - quantization.py: 6 patches - quantized_tensor.py: 1 patch - cpu_offload.py: 1 patch - jit.py: 3 patches All files passed Python AST syntax validation.
Added missing import for InstallCommand from setuptools.command.install to fix NameError during build.
These P2 files were git-added during Stage 3 merge but still contained conflict markers. Fixed by checking out the upstream v2.17 version for all affected files: - 43 source files (transformer_engine/common, pytorch, jax) - 10 test files - 4 doc/example files - 1 empty artifact removed (quantization_nvfp4.py renamed upstream) 64 files changed, accepting upstream version for all.
These files were generated during the v2.17 sync workflow for debugging and documentation purposes. They should not be part of the final PR.
Caozhou1995
force-pushed
the
sync-upstream-v2.17
branch
from
August 10, 2026 04:17
d29093a to
f7b076f
Compare
- ops.py: Add 15 new API declarations, update 4 existing signatures - cuda backend: Add 15 new methods, update 4 signatures in cuda.py and register_ops.py - All vendor backends (enflame/iluvatar/metax/musa/hygon): Add 19 new methods + OpImpl entries New APIs: splits_to_offsets_multi, copy_data_ptrs_to_device, bulk_allocate, create_empty_quantized_tensor, group_dequantize, get_grouped_gemm_setup_workspace_size, multi_tensor_pad_last_dim, multi_tensor_swizzle_scales_for_gemm_, multi_tensor_transpose_to_bhsd, cusolvermp_ctx_create, cusolvermp_ctx_destroy, newton_schulz, nvfp4_quantize_with_amax, nvfp4_group_quantize_with_amax, swizzle_scales_and_pack_ptrs_for_discrete_weights Modified signatures: group_quantize, bgrad_group_quantize (+tensor_offsets), clamped_swiglu, clamped_dswiglu (+glu_linear_offset)
The Stage 3 merge overwrote transformer_engine/__init__.py with upstream's version, losing the fork-specific TE_DEVICE_TYPE='cuda' default and the te_device_type() helper function. Multiple files depend on these: - transformer_engine/pytorch/utils.py - transformer_engine/pytorch/cpu_offload.py - transformer_engine/pytorch/distributed.py - transformer_engine/pytorch/jit.py - transformer_engine/debug/features/utils/stats_buffer.py - transformer_engine/pytorch/ops/fused/*.py
…Attention - Replace hardcoded device='cuda' with device=te_device_type() (2 locations) - Replace is_cuda checks with device.type == te_device_type() (3 locations) - These changes were lost during v2.17 upstream merge - Restores multi-backend compatibility from commit 4f54860
- triton/permutation.py: 12 te_device_type() calls restored - utils.py: 5 te_device_type() calls restored (_empty_tensor, normalize_device, torch_get_autocast_gpu_dtype)
…or, gemm, optimizers)
…ntion - Fix dot_product_attention.py: use 'from transformer_engine import te_device_type' instead of debug_state import - Add missing import in layernorm_mlp.py - Add missing import in quantization.py All imports now follow main branch convention: 'from transformer_engine import te_device_type'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: