TE 2.11 compatibility layer and Blackwell (sm_120) CUDA 12.8 support - #1
Open
LilBadger wants to merge 1 commit into
Open
TE 2.11 compatibility layer and Blackwell (sm_120) CUDA 12.8 support#1LilBadger wants to merge 1 commit into
LilBadger wants to merge 1 commit into
Conversation
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.
Motivation
Description
cosmos_predict1/utils/te_compat.pythat resolvesapply_rotary_pos_embacross TE 2.x/legacy locations, provides a pure-torch RoPE fallback, and exposes safe wrappers forcheck_set_window_size,InferenceParams,DotProductAttentionand a stablesplit_along_dimhelper (no_SplitAlongDimusage).diffusion/module/attention.py,diffusion/training/module/blocks.py,diffusion/training/utils/peft/lora_attn.py,autoregressive/training/modules/attention.py, etc.) to use the compat layer and removed direct internal TE symbol usage.scaled_dot_product_attention(SDPA) with correctqkv_formathandling so inference still runs with numerically reasonable results.cosmos-predict1.yaml, changedrequirements.txtto recommendtorch==2.8.0/torchvision==0.23.0, addedtransformer-engine==2.11.0,transformer-engine-torch==2.11.0andnvidia-cudnn-cu12>=9.3, addedscripts/install_blackwell_wsl.shandscripts/doctor.py, and updatedREADME.md/INSTALL.mdwith a new "Blackwell (sm_120) / CUDA 12.8" section and build/runtime hints (e.g.TORCH_CUDA_ARCH_LIST,NVTE_CUDA_ARCHS, and DO NOT setCUDA_HOME=$CONDA_PREFIXfor runtime).TELoRALinearLayer) so they raise/import only when TE is actually required, and added small compatibility shims for missing TE symbols to avoid import-time crashes.Testing
apply_rotary_pos_embfallback works withpython -c "from cosmos_predict1.utils.te_compat import apply_rotary_pos_emb; print('OK')"which printedOK(success).import cosmos_predict1.diffusion.module.attention,import cosmos_predict1.diffusion.training.utils.peft.lora_attn, andimport cosmos_predict1.autoregressive.training.modules.attentionall imported without error (success).python scripts/doctor.pywhich printedtorch/CUDA details and correctly reported TE import failure in this CI/container (no GPU/TE installed) and that the attention backend will use thetorch_sdpa_fallback(expected behavior in absence of TE).python -c "import torch; print(torch.cuda.get_arch_list())"which returned[]in this environment (no GPU available) but the script validates that the check runs (behavior is environment-dependent).Codex Task