From ee5ea00aa8fe987056f2ca17d39bd60cfb377538 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Mon, 4 May 2026 12:16:26 -0700 Subject: [PATCH 01/12] fix tokenizers Signed-off-by: dimapihtar --- .../core/tokenizers/vision/libraries/multimodal_tokenizer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 80712351095..044fe925a8f 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -256,9 +256,8 @@ def tokenize_conversation( tokenize=True, add_generation_prompt=add_generation_prompt, return_assistant_token_mask=False, - return_tensors="np", chat_template=self._prompt_config.custom_chat_template, - )[0] + ) if not return_target: return tokens From 9b0aa6928e567111883592bd34d51c38c35350c3 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Mon, 4 May 2026 14:26:37 -0700 Subject: [PATCH 02/12] minor fix Signed-off-by: dimapihtar --- .../vision/libraries/multimodal_tokenizer.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 044fe925a8f..967044ae1ec 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -251,12 +251,14 @@ def tokenize_conversation( # Apply possible image tag. conversation = self._apply_image_tag(conversation) - tokens = self.tokenizer.apply_chat_template( - conversation, - tokenize=True, - add_generation_prompt=add_generation_prompt, - return_assistant_token_mask=False, - chat_template=self._prompt_config.custom_chat_template, + tokens = np.array( + self.tokenizer.apply_chat_template( + conversation, + tokenize=True, + add_generation_prompt=add_generation_prompt, + return_assistant_token_mask=False, + chat_template=self._prompt_config.custom_chat_template, + ) ) if not return_target: From 0da0924a640e3ae68d273c18cb05873d35241ea6 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 06:47:50 -0700 Subject: [PATCH 03/12] set return_dict=False Signed-off-by: dimapihtar --- .../vision/libraries/multimodal_tokenizer.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 967044ae1ec..5009e0a5bc8 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -251,15 +251,14 @@ def tokenize_conversation( # Apply possible image tag. conversation = self._apply_image_tag(conversation) - tokens = np.array( - self.tokenizer.apply_chat_template( - conversation, - tokenize=True, - add_generation_prompt=add_generation_prompt, - return_assistant_token_mask=False, - chat_template=self._prompt_config.custom_chat_template, - ) - ) + tokens = self.tokenizer.apply_chat_template( + conversation, + tokenize=True, + add_generation_prompt=add_generation_prompt, + return_assistant_token_mask=False, + return_dict=False, + chat_template=self._prompt_config.custom_chat_template, + )[0] if not return_target: return tokens From 95b53e502679a4803ca8ccf151b4c5251b65813c Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 06:54:26 -0700 Subject: [PATCH 04/12] minor fix Signed-off-by: dimapihtar --- .../core/tokenizers/vision/libraries/multimodal_tokenizer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 5009e0a5bc8..088f635a6b5 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -256,6 +256,7 @@ def tokenize_conversation( tokenize=True, add_generation_prompt=add_generation_prompt, return_assistant_token_mask=False, + return_tensors="np", return_dict=False, chat_template=self._prompt_config.custom_chat_template, )[0] From 62e86d18fdbceffe249cb962b47d40211b84efab Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 07:15:30 -0700 Subject: [PATCH 05/12] upgrade transformers version Signed-off-by: dimapihtar --- examples/multimodal/Dockerfile | 2 +- megatron_core.egg-info.bak/PKG-INFO | 255 ++++++++++ megatron_core.egg-info.bak/SOURCES.txt | 444 ++++++++++++++++++ .../dependency_links.txt | 1 + megatron_core.egg-info.bak/requires.txt | 65 +++ megatron_core.egg-info.bak/top_level.txt | 1 + 6 files changed, 767 insertions(+), 1 deletion(-) create mode 100644 megatron_core.egg-info.bak/PKG-INFO create mode 100644 megatron_core.egg-info.bak/SOURCES.txt create mode 100644 megatron_core.egg-info.bak/dependency_links.txt create mode 100644 megatron_core.egg-info.bak/requires.txt create mode 100644 megatron_core.egg-info.bak/top_level.txt diff --git a/examples/multimodal/Dockerfile b/examples/multimodal/Dockerfile index d7c4fd41af5..4ed66900179 100644 --- a/examples/multimodal/Dockerfile +++ b/examples/multimodal/Dockerfile @@ -16,7 +16,7 @@ RUN uv pip install --system --no-cache --break-system-packages \ braceexpand \ webdataset \ packaging \ - "transformers<5.0.0" \ + transformers \ datasets \ accelerate \ timm \ diff --git a/megatron_core.egg-info.bak/PKG-INFO b/megatron_core.egg-info.bak/PKG-INFO new file mode 100644 index 00000000000..05bbfded449 --- /dev/null +++ b/megatron_core.egg-info.bak/PKG-INFO @@ -0,0 +1,255 @@ +Metadata-Version: 2.4 +Name: megatron-core +Version: 0.18.0rc0 +Summary: Megatron Core - a library for efficient and scalable training of transformer based models +Author-email: NVIDIA +Maintainer-email: NVIDIA +License: Apache 2.0 +Project-URL: Download, https://github.com/NVIDIA/Megatron-LM/releases +Project-URL: Homepage, https://github.com/NVIDIA/Megatron-LM +Keywords: NLP,NLU,deep,gpu,language,learning,machine,nvidia,pytorch,torch,transformer +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Natural Language :: English +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence +Classifier: Topic :: Scientific/Engineering :: Image Recognition +Classifier: Topic :: Scientific/Engineering :: Mathematics +Classifier: Topic :: Scientific/Engineering +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Utilities +Requires-Python: >=3.12 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: torch>=2.6.0 +Requires-Dist: numpy +Requires-Dist: packaging>=24.2 +Provides-Extra: training +Requires-Dist: flask-restful; extra == "training" +Requires-Dist: sentencepiece; extra == "training" +Requires-Dist: tiktoken; extra == "training" +Requires-Dist: wandb; extra == "training" +Requires-Dist: transformers; extra == "training" +Requires-Dist: accelerate; extra == "training" +Provides-Extra: mlm +Requires-Dist: flask-restful; extra == "mlm" +Requires-Dist: sentencepiece; extra == "mlm" +Requires-Dist: tiktoken; extra == "mlm" +Requires-Dist: wandb; extra == "mlm" +Requires-Dist: transformers; extra == "mlm" +Requires-Dist: accelerate; extra == "mlm" +Provides-Extra: dev +Requires-Dist: nvidia-modelopt[torch]; sys_platform != "darwin" and extra == "dev" +Requires-Dist: transformer-engine[core_cu13,pytorch]; extra == "dev" +Requires-Dist: nvidia-resiliency-ext; extra == "dev" +Requires-Dist: tqdm; extra == "dev" +Requires-Dist: einops~=0.8; extra == "dev" +Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "dev" +Requires-Dist: nvtx~=0.2; extra == "dev" +Requires-Dist: multi-storage-client~=0.27; extra == "dev" +Requires-Dist: opentelemetry-api~=1.33.1; extra == "dev" +Requires-Dist: mamba-ssm~=2.2; extra == "dev" +Requires-Dist: causal-conv1d~=1.5; extra == "dev" +Requires-Dist: flash-linear-attention~=0.4.0; extra == "dev" +Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "dev" +Requires-Dist: av; extra == "dev" +Requires-Dist: flashinfer-python~=0.5.0; extra == "dev" +Requires-Dist: wget; extra == "dev" +Requires-Dist: onnxscript; extra == "dev" +Requires-Dist: fastapi~=0.50; extra == "dev" +Requires-Dist: datasets; extra == "dev" +Requires-Dist: emerging_optimizers; extra == "dev" +Requires-Dist: hypercorn; extra == "dev" +Requires-Dist: quart; extra == "dev" +Requires-Dist: openai[aiohttp]; extra == "dev" +Requires-Dist: orjson; extra == "dev" +Provides-Extra: lts +Requires-Dist: tqdm; extra == "lts" +Requires-Dist: einops~=0.8; extra == "lts" +Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "lts" +Requires-Dist: nvtx~=0.2; extra == "lts" +Requires-Dist: multi-storage-client~=0.27; extra == "lts" +Requires-Dist: opentelemetry-api~=1.33.1; extra == "lts" +Requires-Dist: mamba-ssm~=2.2; extra == "lts" +Requires-Dist: causal-conv1d~=1.5; extra == "lts" +Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "lts" +Requires-Dist: av; extra == "lts" +Requires-Dist: flashinfer-python~=0.5.0; extra == "lts" +Requires-Dist: wget; extra == "lts" +Requires-Dist: onnxscript; extra == "lts" +Requires-Dist: fastapi~=0.50; extra == "lts" +Requires-Dist: datasets; extra == "lts" +Requires-Dist: emerging_optimizers; extra == "lts" +Dynamic: license-file + +
+ +Megatron-LM and Megatron Core +============================= + +

GPU-optimized library for training transformer models at scale

+ +[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html) +[![version](https://img.shields.io/badge/release-0.15.0-green)](./CHANGELOG.md) +[![license](https://img.shields.io/badge/license-Apache-blue)](./LICENSE) + +
+ +## About + +This repository contains two components: **Megatron-LM** and **Megatron Core**. + +**Megatron-LM** is a reference example that includes Megatron Core plus pre-configured training scripts. Best for research teams, learning distributed training, and quick experimentation. + +**Megatron Core** is a composable library with GPU-optimized building blocks for custom training frameworks. It provides transformer building blocks, advanced parallelism strategies (TP, PP, DP, EP, CP), mixed precision support (FP16, BF16, FP8, FP4), and model architectures. Best for framework developers and ML engineers building custom training pipelines. + +**[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** provides bidirectional Hugging Face ↔ Megatron checkpoint conversion with production-ready recipes. + +## Getting Started + +**Install from PyPI:** + +```bash +uv pip install megatron-core +``` + +**Or clone and install from source:** + +```bash +git clone https://github.com/NVIDIA/Megatron-LM.git +cd Megatron-LM +uv pip install -e . +``` + +> **Note:** Building from source can use a lot of memory. If the build runs out of memory, limit parallel compilation jobs by setting `MAX_JOBS` (e.g. `MAX_JOBS=4 uv pip install -e .`). + +For NGC container setup and all installation options, see the **[Installation Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/install.html)**. + +- **[Your First Training Run](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/quickstart.html)** - End-to-end training examples with data preparation +- **[Parallelism Strategies](https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/parallelism-guide.html)** - Scale training across GPUs with TP, PP, DP, EP, and CP +- **[Contribution Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - How to contribute to Megatron Core + +# Latest News + +- **[2026/03]** **Deprecating Python 3.10 support:** We're officially dropping Python 3.10 support with the upcoming 0.17.0 release. Downstream applications must raise their lower boundary to 3.12 to stay compatible with MCore. +- **[2026/01]** **[Dynamic Context Parallelism](https://developer.nvidia.com/blog/speeding-up-variable-length-training-with-dynamic-context-parallelism-and-nvidia-megatron-core/)** - Up to 1.48x speedup for variable-length sequence training with adaptive CP sizing. +- **[2025/12]** **Megatron Core development has moved to GitHub!** All development and CI now happens in the open. We welcome community contributions. +- **[2025/10]** **[Megatron Dev Branch](https://github.com/NVIDIA/Megatron-LM/tree/dev)** - early access branch with experimental features. +- **[2025/10]** **[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** - Bidirectional converter for interoperability between Hugging Face and Megatron checkpoints, featuring production-ready recipes for popular models. +- **[2025/08]** **[MoE Q3-Q4 2025 Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - Comprehensive roadmap for MoE features including DeepSeek-V3, Qwen3, advanced parallelism strategies, FP8 optimizations, and Blackwell performance enhancements. +- **[2025/08]** **[GPT-OSS Model](https://github.com/NVIDIA/Megatron-LM/issues/1739)** - Advanced features including YaRN RoPE scaling, attention sinks, and custom activation functions are being integrated into Megatron Core. +- **[2025/06]** **[Megatron MoE Model Zoo](https://github.com/yanring/Megatron-MoE-ModelZoo)** - Best practices and optimized configurations for training DeepSeek-V3, Mixtral, and Qwen3 MoE models with performance benchmarking and checkpoint conversion tools. +- **[2025/05]** Megatron Core v0.11.0 brings new capabilities for multi-data center LLM training ([blog](https://developer.nvidia.com/blog/turbocharge-llm-training-across-long-haul-data-center-networks-with-nvidia-nemo-framework/)). + +
+Previous News + +- **[2024/07]** Megatron Core v0.7 improves scalability and training resiliency and adds support for multimodal training ([blog](https://developer.nvidia.com/blog/train-generative-ai-models-more-efficiently-with-new-nvidia-Megatron-Core-functionalities/)). +- **[2024/06]** Megatron Core added supports for Mamba-based models. Check out our paper [An Empirical Study of Mamba-based Language Models](https://arxiv.org/pdf/2406.07887) and [code example](https://github.com/NVIDIA/Megatron-LM/tree/ssm/examples/mamba). +- **[2024/01 Announcement]** NVIDIA has released the core capabilities in **Megatron-LM** into [**Megatron Core**](https://github.com/NVIDIA/Megatron-LM/tree/main/megatron/core) in this repository. Megatron Core expands upon Megatron-LM's GPU-optimized techniques with more cutting-edge innovations on system-level optimizations, featuring composable and modular APIs. + +
+ +# Project Structure + +``` +Megatron-LM/ +├── megatron/ +│ ├── core/ # Megatron Core (kernels, parallelism, building blocks) +│ │ ├── models/ # Transformer models +│ │ ├── transformer/ # Transformer building blocks +│ │ ├── tensor_parallel/ # Tensor parallelism +│ │ ├── pipeline_parallel/ # Pipeline parallelism +│ │ ├── distributed/ # Distributed training (FSDP, DDP) +│ │ ├── optimizer/ # Optimizers +│ │ ├── datasets/ # Dataset loaders +│ │ ├── inference/ # Inference engines and server +│ │ └── export/ # Model export (e.g. TensorRT-LLM) +│ ├── training/ # Training scripts +│ ├── legacy/ # Legacy components +│ ├── post_training/ # Post-training (quantization, distillation, pruning, etc.) +│ └── rl/ # Reinforcement learning (RLHF, etc.) +├── examples/ # Ready-to-use training examples +├── tools/ # Utility tools +├── tests/ # Comprehensive test suite +└── docs/ # Documentation +``` + +# Performance Benchmarking + +For our latest performance benchmarking results, please refer to [NVIDIA Megatron Bridge Performance Summary](https://docs.nvidia.com/nemo/megatron-bridge/latest/performance-summary.html). + +Our codebase efficiently trains models from 2B to 462B parameters across thousands of GPUs, achieving up to **47% Model FLOP Utilization (MFU)** on H100 clusters. + +![Model table](images/model_table.png) + +**Benchmark Configuration:** + +- **Vocabulary size**: 131,072 tokens +- **Sequence length**: 4096 tokens +- **Model scaling**: Varied hidden size, attention heads, and layers to achieve target parameter counts +- **Communication optimizations**: Fine-grained overlapping with DP (`--overlap-grad-reduce`, `--overlap-param-gather`), TP (`--tp-comm-overlap`), and PP (enabled by default) + +**Key Results:** + +- **6144 H100 GPUs**: Successfully benchmarked 462B parameter model training +- **Superlinear scaling**: MFU increases from 41% to 47-48% with model size +- **End-to-end measurement**: Throughputs include all operations (data loading, optimizer steps, communication, logging) +- **Production ready**: Full training pipeline with checkpointing and fault tolerance +- *Note: Performance results measured without training to convergence* + +## Weak Scaling Results + +Our weak scaled results show superlinear scaling (MFU increases from 41% for the smallest model considered to 47-48% for the largest models); this is because larger GEMMs have higher arithmetic intensity and are consequently more efficient to execute. + +![Weak scaling](images/weak_scaling.png) + +## Strong Scaling Results + +We also strong scaled the standard GPT-3 model (our version has slightly more than 175 billion parameters due to larger vocabulary size) from 96 H100 GPUs to 4608 GPUs, using the same batch size of 1152 sequences throughout. Communication becomes more exposed at larger scale, leading to a reduction in MFU from 47% to 42%. + +![Strong scaling](images/strong_scaling.png) + +# Roadmaps + +- **[MoE Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - DeepSeek-V3, Qwen3, advanced parallelism, FP8 optimizations, and Blackwell enhancements + +# Resources + +## Getting Help + +- 📖 **[Documentation](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html)** - Official documentation +- 🐛 **[Issues](https://github.com/NVIDIA/Megatron-LM/issues)** - Bug reports and feature requests + +## Contributing + +We ❤️ contributions! Ways to contribute: + +- 🐛 **Report bugs** - Help us improve reliability +- 💡 **Suggest features** - Shape the future of Megatron Core +- 📝 **Improve docs** - Make Megatron Core more accessible +- 🔧 **Submit PRs** - Contribute code improvements + +**→ [Contributing Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** + +## Citation + +If you use Megatron in your research or project, we appreciate that you use the following citations: + +```bibtex +@article{megatron-lm, + title={Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism}, + author={Shoeybi, Mohammad and Patwary, Mostofa and Puri, Raul and LeGresley, Patrick and Casper, Jared and Catanzaro, Bryan}, + journal={arXiv preprint arXiv:1909.08053}, + year={2019} +} +``` diff --git a/megatron_core.egg-info.bak/SOURCES.txt b/megatron_core.egg-info.bak/SOURCES.txt new file mode 100644 index 00000000000..4c57cedb34b --- /dev/null +++ b/megatron_core.egg-info.bak/SOURCES.txt @@ -0,0 +1,444 @@ +LICENSE +MANIFEST.in +README.md +pyproject.toml +setup.py +megatron/core/README.md +megatron/core/__init__.py +megatron/core/_rank_utils.py +megatron/core/activations.py +megatron/core/config.py +megatron/core/config_logger.py +megatron/core/energy_monitor.py +megatron/core/enums.py +megatron/core/fp4_utils.py +megatron/core/fp8_utils.py +megatron/core/full_cuda_graph.py +megatron/core/hyper_comm_grid.py +megatron/core/inference_params.py +megatron/core/jit.py +megatron/core/model_parallel_config.py +megatron/core/msc_utils.py +megatron/core/nccl_allocator.py +megatron/core/num_microbatches_calculator.py +megatron/core/optimizer_param_scheduler.py +megatron/core/package_info.py +megatron/core/packed_seq_params.py +megatron/core/parallel_state.py +megatron/core/process_groups_config.py +megatron/core/requirements.txt +megatron/core/rerun_state_machine.py +megatron/core/safe_globals.py +megatron/core/timers.py +megatron/core/typed_torch.py +megatron/core/utils.py +megatron/core/datasets/__init__.py +megatron/core/datasets/bert_dataset.py +megatron/core/datasets/blended_dataset.py +megatron/core/datasets/blended_megatron_dataset_builder.py +megatron/core/datasets/blended_megatron_dataset_config.py +megatron/core/datasets/data_schedule.py +megatron/core/datasets/gpt_dataset.py +megatron/core/datasets/helpers.cpp +megatron/core/datasets/helpers.py +megatron/core/datasets/indexed_dataset.py +megatron/core/datasets/masked_dataset.py +megatron/core/datasets/megatron_dataset.py +megatron/core/datasets/multimodal_dataset.py +megatron/core/datasets/object_storage_utils.py +megatron/core/datasets/t5_dataset.py +megatron/core/datasets/utils.py +megatron/core/datasets/utils_s3.py +megatron/core/dist_checkpointing/__init__.py +megatron/core/dist_checkpointing/core.py +megatron/core/dist_checkpointing/dict_utils.py +megatron/core/dist_checkpointing/exchange_utils.py +megatron/core/dist_checkpointing/mapping.py +megatron/core/dist_checkpointing/optimizer.py +megatron/core/dist_checkpointing/serialization.py +megatron/core/dist_checkpointing/state_dict_utils.py +megatron/core/dist_checkpointing/tensor_aware_state_dict.py +megatron/core/dist_checkpointing/utils.py +megatron/core/dist_checkpointing/validation.py +megatron/core/dist_checkpointing/strategies/__init__.py +megatron/core/dist_checkpointing/strategies/async_utils.py +megatron/core/dist_checkpointing/strategies/base.py +megatron/core/dist_checkpointing/strategies/cached_metadata_filesystem_reader.py +megatron/core/dist_checkpointing/strategies/checkpointable.py +megatron/core/dist_checkpointing/strategies/common.py +megatron/core/dist_checkpointing/strategies/filesystem_async.py +megatron/core/dist_checkpointing/strategies/fully_parallel.py +megatron/core/dist_checkpointing/strategies/state_dict_saver.py +megatron/core/dist_checkpointing/strategies/torch.py +megatron/core/distributed/__init__.py +megatron/core/distributed/data_parallel_base.py +megatron/core/distributed/distributed_data_parallel.py +megatron/core/distributed/distributed_data_parallel_config.py +megatron/core/distributed/finalize_model_grads.py +megatron/core/distributed/param_and_grad_buffer.py +megatron/core/distributed/reduce_scatter_with_fp32_accumulation.py +megatron/core/distributed/torch_fully_sharded_data_parallel.py +megatron/core/distributed/torch_fully_sharded_data_parallel_config.py +megatron/core/distributed/fsdp/__init__.py +megatron/core/distributed/fsdp/mcore_fsdp_adapter.py +megatron/core/distributed/fsdp/src/__init__.py +megatron/core/distributed/fsdp/src/megatron_fsdp/__init__.py +megatron/core/distributed/fsdp/src/megatron_fsdp/distributed_data_parallel_config.py +megatron/core/distributed/fsdp/src/megatron_fsdp/fully_shard.py +megatron/core/distributed/fsdp/src/megatron_fsdp/megatron_fsdp.py +megatron/core/distributed/fsdp/src/megatron_fsdp/mixed_precision.py +megatron/core/distributed/fsdp/src/megatron_fsdp/package_info.py +megatron/core/distributed/fsdp/src/megatron_fsdp/param_and_grad_buffer.py +megatron/core/distributed/fsdp/src/megatron_fsdp/uneven_dtensor.py +megatron/core/distributed/fsdp/src/megatron_fsdp/utils.py +megatron/core/export/__init__.py +megatron/core/export/data_type.py +megatron/core/export/export_config.py +megatron/core/export/model_type.py +megatron/core/export/trtllm/__init__.py +megatron/core/export/trtllm/trt_model_config.py +megatron/core/export/trtllm/trt_model_type.py +megatron/core/export/trtllm/trtllm_helper.py +megatron/core/export/trtllm/trtllm_layers.py +megatron/core/export/trtllm/engine_builder/__init__.py +megatron/core/export/trtllm/engine_builder/trtllm_engine_builder.py +megatron/core/export/trtllm/model_to_trllm_mapping/__init__.py +megatron/core/export/trtllm/model_to_trllm_mapping/default_conversion_dict.py +megatron/core/export/trtllm/trtllm_weights_converter/__init__.py +megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py +megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py +megatron/core/export/trtllm/trtllm_weights_converter/utils.py +megatron/core/extensions/__init__.py +megatron/core/extensions/kitchen.py +megatron/core/extensions/transformer_engine.py +megatron/core/extensions/transformer_engine_spec_provider.py +megatron/core/fusions/__init__.py +megatron/core/fusions/fused_bias_dropout.py +megatron/core/fusions/fused_bias_geglu.py +megatron/core/fusions/fused_bias_gelu.py +megatron/core/fusions/fused_bias_swiglu.py +megatron/core/fusions/fused_cross_entropy.py +megatron/core/fusions/fused_indices_converter.py +megatron/core/fusions/fused_layer_norm.py +megatron/core/fusions/fused_mla_yarn_rope_apply.py +megatron/core/fusions/fused_pad_routing_map.py +megatron/core/fusions/fused_softmax.py +megatron/core/fusions/fused_weighted_squared_relu.py +megatron/core/inference/__init__.py +megatron/core/inference/async_stream.py +megatron/core/inference/batch_dimensions_utils.py +megatron/core/inference/common_inference_params.py +megatron/core/inference/communication_utils.py +megatron/core/inference/config.py +megatron/core/inference/data_parallel_inference_coordinator.py +megatron/core/inference/headers.py +megatron/core/inference/inference_client.py +megatron/core/inference/inference_request.py +megatron/core/inference/sampling_params.py +megatron/core/inference/scheduler.py +megatron/core/inference/symmetric_memory.py +megatron/core/inference/unified_memory.py +megatron/core/inference/utils.py +megatron/core/inference/communication/torch_symm_triton/__init__.py +megatron/core/inference/communication/torch_symm_triton/barrier.py +megatron/core/inference/communication/torch_symm_triton/collectives.py +megatron/core/inference/communication/torch_symm_triton/fused_collectives.py +megatron/core/inference/communication/torch_symm_triton/multimem_asm.py +megatron/core/inference/communication/torch_symm_triton/utils.py +megatron/core/inference/contexts/__init__.py +megatron/core/inference/contexts/base_context.py +megatron/core/inference/contexts/dynamic_context.py +megatron/core/inference/contexts/fused_kv_append_kernel.py +megatron/core/inference/contexts/kv_block_allocator.py +megatron/core/inference/contexts/mamba_slot_allocator.py +megatron/core/inference/contexts/routing_metadata.py +megatron/core/inference/contexts/static_context.py +megatron/core/inference/contexts/attention_context/mamba_metadata.py +megatron/core/inference/contexts/attention_context/metadata_base.py +megatron/core/inference/contexts/attention_context/mha_metadata.py +megatron/core/inference/contexts/attention_context/triton/tensor_ops.py +megatron/core/inference/engines/__init__.py +megatron/core/inference/engines/abstract_engine.py +megatron/core/inference/engines/async_zmq_communicator.py +megatron/core/inference/engines/dynamic_engine.py +megatron/core/inference/engines/mcore_engine.py +megatron/core/inference/engines/static_engine.py +megatron/core/inference/model_inference_wrappers/__init__.py +megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/gpt/__init__.py +megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/multimodal/vlm_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/t5/__init__.py +megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py +megatron/core/inference/moe/__init__.py +megatron/core/inference/moe/activations.py +megatron/core/inference/moe/fused_moe.py +megatron/core/inference/moe/pad.py +megatron/core/inference/moe/permute.py +megatron/core/inference/quantization/__init__.py +megatron/core/inference/quantization/mxfp8_quantize.py +megatron/core/inference/quantization/mxfp8_tensor.py +megatron/core/inference/quantization/utils.py +megatron/core/inference/text_generation_controllers/__init__.py +megatron/core/inference/text_generation_controllers/encoder_decoder_text_generation_controller.py +megatron/core/inference/text_generation_controllers/text_generation_controller.py +megatron/core/inference/text_generation_controllers/vlm_text_generation_controller.py +megatron/core/inference/text_generation_server/__init__.py +megatron/core/inference/text_generation_server/run_mcore_engine.py +megatron/core/inference/text_generation_server/text_generation_server.py +megatron/core/inference/text_generation_server/tokenization.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/__init__.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/text_generation_server.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/tokenization.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/__init__.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/chat_completions.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/common.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/completions.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/health.py +megatron/core/inference/text_generation_server/endpoints/common.py +megatron/core/inference/text_generation_server/endpoints/completions.py +megatron/core/models/__init__.py +megatron/core/models/backends.py +megatron/core/models/T5/__init__.py +megatron/core/models/T5/t5_model.py +megatron/core/models/T5/t5_spec.py +megatron/core/models/bert/__init__.py +megatron/core/models/bert/bert_layer_specs.py +megatron/core/models/bert/bert_lm_head.py +megatron/core/models/bert/bert_model.py +megatron/core/models/bert/pooler.py +megatron/core/models/common/__init__.py +megatron/core/models/common/model_chunk_schedule_plan.py +megatron/core/models/common/embeddings/__init__.py +megatron/core/models/common/embeddings/language_model_embedding.py +megatron/core/models/common/embeddings/relative_pos_embedding.py +megatron/core/models/common/embeddings/rope_utils.py +megatron/core/models/common/embeddings/rotary_pos_embedding.py +megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py +megatron/core/models/common/language_module/__init__.py +megatron/core/models/common/language_module/language_module.py +megatron/core/models/common/vision_module/__init__.py +megatron/core/models/common/vision_module/vision_module.py +megatron/core/models/gpt/__init__.py +megatron/core/models/gpt/experimental_attention_variant_module_specs.py +megatron/core/models/gpt/fine_grained_callables.py +megatron/core/models/gpt/gpt_layer_specs.py +megatron/core/models/gpt/gpt_model.py +megatron/core/models/gpt/moe_module_specs.py +megatron/core/models/gpt/heterogeneous/heterogeneous_layer_specs.py +megatron/core/models/huggingface/__init__.py +megatron/core/models/huggingface/clip_model.py +megatron/core/models/huggingface/module.py +megatron/core/models/huggingface/qwen_model.py +megatron/core/models/mamba/__init__.py +megatron/core/models/mamba/mamba_layer_specs.py +megatron/core/models/mamba/mamba_model.py +megatron/core/models/mimo/__init__.py +megatron/core/models/mimo/optimizer.py +megatron/core/models/mimo/config/__init__.py +megatron/core/models/mimo/config/base_configs.py +megatron/core/models/mimo/config/role.py +megatron/core/models/mimo/model/__init__.py +megatron/core/models/mimo/model/base.py +megatron/core/models/mimo/partition/utils.py +megatron/core/models/mimo/submodules/audio.py +megatron/core/models/mimo/submodules/base.py +megatron/core/models/mimo/submodules/vision.py +megatron/core/models/multimodal/__init__.py +megatron/core/models/multimodal/context_parallel.py +megatron/core/models/multimodal/llava_model.py +megatron/core/models/multimodal/llava_spec.py +megatron/core/models/vision/__init__.py +megatron/core/models/vision/clip_vit_model.py +megatron/core/models/vision/multimodal_projector.py +megatron/core/models/vision/radio.py +megatron/core/models/vision/vit_layer_specs.py +megatron/core/optimizer/__init__.py +megatron/core/optimizer/clip_grads.py +megatron/core/optimizer/distrib_optimizer.py +megatron/core/optimizer/emerging_optimizers.py +megatron/core/optimizer/grad_scaler.py +megatron/core/optimizer/layer_wise_optimizer.py +megatron/core/optimizer/muon.py +megatron/core/optimizer/optimizer.py +megatron/core/optimizer/optimizer_config.py +megatron/core/optimizer/optimizer_cuda_graph.py +megatron/core/optimizer/qk_clip.py +megatron/core/optimizer/cpu_offloading/__init__.py +megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py +megatron/core/pipeline_parallel/__init__.py +megatron/core/pipeline_parallel/bridge_communicator.py +megatron/core/pipeline_parallel/combined_1f1b.py +megatron/core/pipeline_parallel/fine_grained_activation_offload.py +megatron/core/pipeline_parallel/hybrid_cp_schedule.py +megatron/core/pipeline_parallel/multimodule_communicator.py +megatron/core/pipeline_parallel/p2p_communication.py +megatron/core/pipeline_parallel/schedules.py +megatron/core/pipeline_parallel/utils.py +megatron/core/post_training/__init__.py +megatron/core/post_training/modelopt/__init__.py +megatron/core/post_training/modelopt/layers.py +megatron/core/post_training/modelopt/gpt/__init__.py +megatron/core/post_training/modelopt/gpt/model_specs.py +megatron/core/post_training/modelopt/gpt/state_dict_hooks.py +megatron/core/post_training/modelopt/mamba/__init__.py +megatron/core/post_training/modelopt/mamba/model_specs.py +megatron/core/quantization/__init__.py +megatron/core/quantization/quant_config.py +megatron/core/quantization/utils.py +megatron/core/resharding/__init__.py +megatron/core/resharding/execution.py +megatron/core/resharding/planner.py +megatron/core/resharding/refit.py +megatron/core/resharding/transforms.py +megatron/core/resharding/utils.py +megatron/core/resharding/copy_services/__init__.py +megatron/core/resharding/copy_services/base.py +megatron/core/resharding/copy_services/gloo_copy_service.py +megatron/core/resharding/copy_services/nccl_copy_service.py +megatron/core/resharding/copy_services/nvshmem_copy_service.py +megatron/core/resharding/nvshmem_copy_service/__init__.py +megatron/core/resharding/nvshmem_copy_service/compat.py +megatron/core/resharding/nvshmem_copy_service/logger.py +megatron/core/resharding/nvshmem_copy_service/nvshmem_types.py +megatron/core/resharding/nvshmem_copy_service/service.py +megatron/core/resharding/nvshmem_copy_service/validation.py +megatron/core/resharding/nvshmem_copy_service/core/__init__.py +megatron/core/resharding/nvshmem_copy_service/core/gpu_resource_manager.py +megatron/core/resharding/nvshmem_copy_service/core/kernel_launcher.py +megatron/core/resharding/nvshmem_copy_service/core/pipeline_executor.py +megatron/core/resharding/nvshmem_copy_service/memory/__init__.py +megatron/core/resharding/nvshmem_copy_service/memory/double_buffer_manager.py +megatron/core/resharding/nvshmem_copy_service/memory/tensor_pointer_utils.py +megatron/core/resharding/nvshmem_copy_service/planning/__init__.py +megatron/core/resharding/nvshmem_copy_service/planning/communication_scheduler.py +megatron/core/resharding/nvshmem_copy_service/planning/gpu_execution_planner.py +megatron/core/resharding/nvshmem_copy_service/planning/task_segmenter.py +megatron/core/resharding/nvshmem_copy_service/planning/workload_packer.py +megatron/core/ssm/__init__.py +megatron/core/ssm/gated_delta_net.py +megatron/core/ssm/mamba_block.py +megatron/core/ssm/mamba_context_parallel.py +megatron/core/ssm/mamba_hybrid_layer_allocation.py +megatron/core/ssm/mamba_layer.py +megatron/core/ssm/mamba_mixer.py +megatron/core/ssm/mlp_layer.py +megatron/core/ssm/triton_cache_manager.py +megatron/core/ssm/ops/__init__.py +megatron/core/ssm/ops/causal_conv1d_triton.py +megatron/core/ssm/ops/causal_conv1d_varlen.py +megatron/core/ssm/ops/determinism.py +megatron/core/ssm/ops/mamba_ssm.py +megatron/core/ssm/ops/ssd_bmm.py +megatron/core/ssm/ops/ssd_chunk_scan.py +megatron/core/ssm/ops/ssd_chunk_state.py +megatron/core/ssm/ops/ssd_combined.py +megatron/core/ssm/ops/ssd_state_passing.py +megatron/core/tensor_parallel/__init__.py +megatron/core/tensor_parallel/cross_entropy.py +megatron/core/tensor_parallel/data.py +megatron/core/tensor_parallel/inference_layers.py +megatron/core/tensor_parallel/layers.py +megatron/core/tensor_parallel/mappings.py +megatron/core/tensor_parallel/random.py +megatron/core/tensor_parallel/utils.py +megatron/core/tokenizers/__init__.py +megatron/core/tokenizers/base_tokenizer.py +megatron/core/tokenizers/megatron_tokenizer.py +megatron/core/tokenizers/text/__init__.py +megatron/core/tokenizers/text/text_tokenizer.py +megatron/core/tokenizers/text/libraries/__init__.py +megatron/core/tokenizers/text/libraries/abstract_tokenizer.py +megatron/core/tokenizers/text/libraries/bytelevel_tokenizer.py +megatron/core/tokenizers/text/libraries/chat_template.py +megatron/core/tokenizers/text/libraries/huggingface_tokenizer.py +megatron/core/tokenizers/text/libraries/megatron_hf_tokenizer.py +megatron/core/tokenizers/text/libraries/null_tokenizer.py +megatron/core/tokenizers/text/libraries/sentencepiece_tokenizer.py +megatron/core/tokenizers/text/libraries/sft_tokenizer.py +megatron/core/tokenizers/text/libraries/tiktoken_tokenizer.py +megatron/core/tokenizers/text/models/__init__.py +megatron/core/tokenizers/text/models/bert_tokenizer.py +megatron/core/tokenizers/text/models/default_tokenizer.py +megatron/core/tokenizers/text/models/gpt_tokenizer.py +megatron/core/tokenizers/text/models/mamba_tokenizer.py +megatron/core/tokenizers/text/models/t5_tokenizer.py +megatron/core/tokenizers/text/parsers/__init__.py +megatron/core/tokenizers/text/parsers/base_parser.py +megatron/core/tokenizers/text/parsers/deepseek_r1_reasoning_parser.py +megatron/core/tokenizers/text/parsers/qwen3_coder_tool_parser.py +megatron/core/tokenizers/utils/build_tokenizer.py +megatron/core/tokenizers/vision/__init__.py +megatron/core/tokenizers/vision/vision_tokenizer.py +megatron/core/tokenizers/vision/libraries/__init__.py +megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +megatron/core/tokenizers/vision/libraries/null_multimodal_tokenizer.py +megatron/core/tokenizers/vision/models/__init__.py +megatron/core/tokenizers/vision/models/default_tokenizer.py +megatron/core/transformer/__init__.py +megatron/core/transformer/attention.py +megatron/core/transformer/cuda_graphs.py +megatron/core/transformer/dot_product_attention.py +megatron/core/transformer/enums.py +megatron/core/transformer/fsdp_dtensor_checkpoint.py +megatron/core/transformer/identity_op.py +megatron/core/transformer/mlp.py +megatron/core/transformer/module.py +megatron/core/transformer/multi_latent_attention.py +megatron/core/transformer/multi_token_prediction.py +megatron/core/transformer/pipeline_parallel_layer_layout.py +megatron/core/transformer/spec_utils.py +megatron/core/transformer/torch_layer_norm.py +megatron/core/transformer/torch_norm.py +megatron/core/transformer/transformer_block.py +megatron/core/transformer/transformer_config.py +megatron/core/transformer/transformer_layer.py +megatron/core/transformer/utils.py +megatron/core/transformer/custom_layers/__init__.py +megatron/core/transformer/custom_layers/batch_invariant_kernels.py +megatron/core/transformer/experimental_attention_variant/absorbed_mla.py +megatron/core/transformer/experimental_attention_variant/dsa.py +megatron/core/transformer/heterogeneous/heterogeneous_config.py +megatron/core/transformer/heterogeneous/linear_replacements.py +megatron/core/transformer/moe/__init__.py +megatron/core/transformer/moe/experts.py +megatron/core/transformer/moe/fused_a2a.py +megatron/core/transformer/moe/moe_layer.py +megatron/core/transformer/moe/moe_utils.py +megatron/core/transformer/moe/router.py +megatron/core/transformer/moe/router_replay.py +megatron/core/transformer/moe/shared_experts.py +megatron/core/transformer/moe/token_dispatcher.py +megatron/core/transformer/moe/token_dispatcher_inference.py +megatron/core/transformer/moe/upcycling_utils.py +megatron/training/__init__.py +megatron/training/argument_utils.py +megatron/training/arguments.py +megatron/training/async_utils.py +megatron/training/checkpointing.py +megatron/training/dgrad_logging.py +megatron/training/dist_signal_handler.py +megatron/training/ft_integration.py +megatron/training/global_vars.py +megatron/training/initialize.py +megatron/training/inprocess_restart.py +megatron/training/log_handler.py +megatron/training/one_logger_utils.py +megatron/training/theoretical_memory_usage.py +megatron/training/training.py +megatron/training/utils.py +megatron/training/wandb_utils.py +megatron/training/yaml_arguments.py +megatron/training/config/__init__.py +megatron/training/config/common_config.py +megatron/training/config/resilience_config.py +megatron/training/config/training_config.py +megatron/training/datasets/__init__.py +megatron/training/datasets/data_samplers.py +megatron/training/datasets/fim_dataset.py +megatron/training/datasets/sft_dataset.py +megatron_core.egg-info/PKG-INFO +megatron_core.egg-info/SOURCES.txt +megatron_core.egg-info/dependency_links.txt +megatron_core.egg-info/requires.txt +megatron_core.egg-info/top_level.txt \ No newline at end of file diff --git a/megatron_core.egg-info.bak/dependency_links.txt b/megatron_core.egg-info.bak/dependency_links.txt new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/megatron_core.egg-info.bak/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/megatron_core.egg-info.bak/requires.txt b/megatron_core.egg-info.bak/requires.txt new file mode 100644 index 00000000000..50312bd5967 --- /dev/null +++ b/megatron_core.egg-info.bak/requires.txt @@ -0,0 +1,65 @@ +torch>=2.6.0 +numpy +packaging>=24.2 + +[dev] +transformer-engine[core_cu13,pytorch] +nvidia-resiliency-ext +tqdm +einops~=0.8 +tensorstore!=0.1.46,!=0.1.72,~=0.1 +nvtx~=0.2 +multi-storage-client~=0.27 +opentelemetry-api~=1.33.1 +mamba-ssm~=2.2 +causal-conv1d~=1.5 +flash-linear-attention~=0.4.0 +megatron-energon[av_decode]~=6.0 +av +flashinfer-python~=0.5.0 +wget +onnxscript +fastapi~=0.50 +datasets +emerging_optimizers +hypercorn +quart +openai[aiohttp] +orjson + +[dev:sys_platform != "darwin"] +nvidia-modelopt[torch] + +[lts] +tqdm +einops~=0.8 +tensorstore!=0.1.46,!=0.1.72,~=0.1 +nvtx~=0.2 +multi-storage-client~=0.27 +opentelemetry-api~=1.33.1 +mamba-ssm~=2.2 +causal-conv1d~=1.5 +megatron-energon[av_decode]~=6.0 +av +flashinfer-python~=0.5.0 +wget +onnxscript +fastapi~=0.50 +datasets +emerging_optimizers + +[mlm] +flask-restful +sentencepiece +tiktoken +wandb +transformers +accelerate + +[training] +flask-restful +sentencepiece +tiktoken +wandb +transformers +accelerate diff --git a/megatron_core.egg-info.bak/top_level.txt b/megatron_core.egg-info.bak/top_level.txt new file mode 100644 index 00000000000..3bfbb11f4a7 --- /dev/null +++ b/megatron_core.egg-info.bak/top_level.txt @@ -0,0 +1 @@ +megatron From 565cecb491c26da496672788a192faecc9351c59 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 07:17:49 -0700 Subject: [PATCH 06/12] Revert "upgrade transformers version" This reverts commit 62e86d18fdbceffe249cb962b47d40211b84efab. --- examples/multimodal/Dockerfile | 2 +- megatron_core.egg-info.bak/PKG-INFO | 255 ---------- megatron_core.egg-info.bak/SOURCES.txt | 444 ------------------ .../dependency_links.txt | 1 - megatron_core.egg-info.bak/requires.txt | 65 --- megatron_core.egg-info.bak/top_level.txt | 1 - 6 files changed, 1 insertion(+), 767 deletions(-) delete mode 100644 megatron_core.egg-info.bak/PKG-INFO delete mode 100644 megatron_core.egg-info.bak/SOURCES.txt delete mode 100644 megatron_core.egg-info.bak/dependency_links.txt delete mode 100644 megatron_core.egg-info.bak/requires.txt delete mode 100644 megatron_core.egg-info.bak/top_level.txt diff --git a/examples/multimodal/Dockerfile b/examples/multimodal/Dockerfile index 4ed66900179..d7c4fd41af5 100644 --- a/examples/multimodal/Dockerfile +++ b/examples/multimodal/Dockerfile @@ -16,7 +16,7 @@ RUN uv pip install --system --no-cache --break-system-packages \ braceexpand \ webdataset \ packaging \ - transformers \ + "transformers<5.0.0" \ datasets \ accelerate \ timm \ diff --git a/megatron_core.egg-info.bak/PKG-INFO b/megatron_core.egg-info.bak/PKG-INFO deleted file mode 100644 index 05bbfded449..00000000000 --- a/megatron_core.egg-info.bak/PKG-INFO +++ /dev/null @@ -1,255 +0,0 @@ -Metadata-Version: 2.4 -Name: megatron-core -Version: 0.18.0rc0 -Summary: Megatron Core - a library for efficient and scalable training of transformer based models -Author-email: NVIDIA -Maintainer-email: NVIDIA -License: Apache 2.0 -Project-URL: Download, https://github.com/NVIDIA/Megatron-LM/releases -Project-URL: Homepage, https://github.com/NVIDIA/Megatron-LM -Keywords: NLP,NLU,deep,gpu,language,learning,machine,nvidia,pytorch,torch,transformer -Classifier: Development Status :: 5 - Production/Stable -Classifier: Environment :: Console -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Information Technology -Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: BSD License -Classifier: Natural Language :: English -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence -Classifier: Topic :: Scientific/Engineering :: Image Recognition -Classifier: Topic :: Scientific/Engineering :: Mathematics -Classifier: Topic :: Scientific/Engineering -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: Software Development :: Libraries -Classifier: Topic :: Utilities -Requires-Python: >=3.12 -Description-Content-Type: text/markdown -License-File: LICENSE -Requires-Dist: torch>=2.6.0 -Requires-Dist: numpy -Requires-Dist: packaging>=24.2 -Provides-Extra: training -Requires-Dist: flask-restful; extra == "training" -Requires-Dist: sentencepiece; extra == "training" -Requires-Dist: tiktoken; extra == "training" -Requires-Dist: wandb; extra == "training" -Requires-Dist: transformers; extra == "training" -Requires-Dist: accelerate; extra == "training" -Provides-Extra: mlm -Requires-Dist: flask-restful; extra == "mlm" -Requires-Dist: sentencepiece; extra == "mlm" -Requires-Dist: tiktoken; extra == "mlm" -Requires-Dist: wandb; extra == "mlm" -Requires-Dist: transformers; extra == "mlm" -Requires-Dist: accelerate; extra == "mlm" -Provides-Extra: dev -Requires-Dist: nvidia-modelopt[torch]; sys_platform != "darwin" and extra == "dev" -Requires-Dist: transformer-engine[core_cu13,pytorch]; extra == "dev" -Requires-Dist: nvidia-resiliency-ext; extra == "dev" -Requires-Dist: tqdm; extra == "dev" -Requires-Dist: einops~=0.8; extra == "dev" -Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "dev" -Requires-Dist: nvtx~=0.2; extra == "dev" -Requires-Dist: multi-storage-client~=0.27; extra == "dev" -Requires-Dist: opentelemetry-api~=1.33.1; extra == "dev" -Requires-Dist: mamba-ssm~=2.2; extra == "dev" -Requires-Dist: causal-conv1d~=1.5; extra == "dev" -Requires-Dist: flash-linear-attention~=0.4.0; extra == "dev" -Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "dev" -Requires-Dist: av; extra == "dev" -Requires-Dist: flashinfer-python~=0.5.0; extra == "dev" -Requires-Dist: wget; extra == "dev" -Requires-Dist: onnxscript; extra == "dev" -Requires-Dist: fastapi~=0.50; extra == "dev" -Requires-Dist: datasets; extra == "dev" -Requires-Dist: emerging_optimizers; extra == "dev" -Requires-Dist: hypercorn; extra == "dev" -Requires-Dist: quart; extra == "dev" -Requires-Dist: openai[aiohttp]; extra == "dev" -Requires-Dist: orjson; extra == "dev" -Provides-Extra: lts -Requires-Dist: tqdm; extra == "lts" -Requires-Dist: einops~=0.8; extra == "lts" -Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "lts" -Requires-Dist: nvtx~=0.2; extra == "lts" -Requires-Dist: multi-storage-client~=0.27; extra == "lts" -Requires-Dist: opentelemetry-api~=1.33.1; extra == "lts" -Requires-Dist: mamba-ssm~=2.2; extra == "lts" -Requires-Dist: causal-conv1d~=1.5; extra == "lts" -Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "lts" -Requires-Dist: av; extra == "lts" -Requires-Dist: flashinfer-python~=0.5.0; extra == "lts" -Requires-Dist: wget; extra == "lts" -Requires-Dist: onnxscript; extra == "lts" -Requires-Dist: fastapi~=0.50; extra == "lts" -Requires-Dist: datasets; extra == "lts" -Requires-Dist: emerging_optimizers; extra == "lts" -Dynamic: license-file - -
- -Megatron-LM and Megatron Core -============================= - -

GPU-optimized library for training transformer models at scale

- -[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html) -[![version](https://img.shields.io/badge/release-0.15.0-green)](./CHANGELOG.md) -[![license](https://img.shields.io/badge/license-Apache-blue)](./LICENSE) - -
- -## About - -This repository contains two components: **Megatron-LM** and **Megatron Core**. - -**Megatron-LM** is a reference example that includes Megatron Core plus pre-configured training scripts. Best for research teams, learning distributed training, and quick experimentation. - -**Megatron Core** is a composable library with GPU-optimized building blocks for custom training frameworks. It provides transformer building blocks, advanced parallelism strategies (TP, PP, DP, EP, CP), mixed precision support (FP16, BF16, FP8, FP4), and model architectures. Best for framework developers and ML engineers building custom training pipelines. - -**[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** provides bidirectional Hugging Face ↔ Megatron checkpoint conversion with production-ready recipes. - -## Getting Started - -**Install from PyPI:** - -```bash -uv pip install megatron-core -``` - -**Or clone and install from source:** - -```bash -git clone https://github.com/NVIDIA/Megatron-LM.git -cd Megatron-LM -uv pip install -e . -``` - -> **Note:** Building from source can use a lot of memory. If the build runs out of memory, limit parallel compilation jobs by setting `MAX_JOBS` (e.g. `MAX_JOBS=4 uv pip install -e .`). - -For NGC container setup and all installation options, see the **[Installation Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/install.html)**. - -- **[Your First Training Run](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/quickstart.html)** - End-to-end training examples with data preparation -- **[Parallelism Strategies](https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/parallelism-guide.html)** - Scale training across GPUs with TP, PP, DP, EP, and CP -- **[Contribution Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - How to contribute to Megatron Core - -# Latest News - -- **[2026/03]** **Deprecating Python 3.10 support:** We're officially dropping Python 3.10 support with the upcoming 0.17.0 release. Downstream applications must raise their lower boundary to 3.12 to stay compatible with MCore. -- **[2026/01]** **[Dynamic Context Parallelism](https://developer.nvidia.com/blog/speeding-up-variable-length-training-with-dynamic-context-parallelism-and-nvidia-megatron-core/)** - Up to 1.48x speedup for variable-length sequence training with adaptive CP sizing. -- **[2025/12]** **Megatron Core development has moved to GitHub!** All development and CI now happens in the open. We welcome community contributions. -- **[2025/10]** **[Megatron Dev Branch](https://github.com/NVIDIA/Megatron-LM/tree/dev)** - early access branch with experimental features. -- **[2025/10]** **[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** - Bidirectional converter for interoperability between Hugging Face and Megatron checkpoints, featuring production-ready recipes for popular models. -- **[2025/08]** **[MoE Q3-Q4 2025 Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - Comprehensive roadmap for MoE features including DeepSeek-V3, Qwen3, advanced parallelism strategies, FP8 optimizations, and Blackwell performance enhancements. -- **[2025/08]** **[GPT-OSS Model](https://github.com/NVIDIA/Megatron-LM/issues/1739)** - Advanced features including YaRN RoPE scaling, attention sinks, and custom activation functions are being integrated into Megatron Core. -- **[2025/06]** **[Megatron MoE Model Zoo](https://github.com/yanring/Megatron-MoE-ModelZoo)** - Best practices and optimized configurations for training DeepSeek-V3, Mixtral, and Qwen3 MoE models with performance benchmarking and checkpoint conversion tools. -- **[2025/05]** Megatron Core v0.11.0 brings new capabilities for multi-data center LLM training ([blog](https://developer.nvidia.com/blog/turbocharge-llm-training-across-long-haul-data-center-networks-with-nvidia-nemo-framework/)). - -
-Previous News - -- **[2024/07]** Megatron Core v0.7 improves scalability and training resiliency and adds support for multimodal training ([blog](https://developer.nvidia.com/blog/train-generative-ai-models-more-efficiently-with-new-nvidia-Megatron-Core-functionalities/)). -- **[2024/06]** Megatron Core added supports for Mamba-based models. Check out our paper [An Empirical Study of Mamba-based Language Models](https://arxiv.org/pdf/2406.07887) and [code example](https://github.com/NVIDIA/Megatron-LM/tree/ssm/examples/mamba). -- **[2024/01 Announcement]** NVIDIA has released the core capabilities in **Megatron-LM** into [**Megatron Core**](https://github.com/NVIDIA/Megatron-LM/tree/main/megatron/core) in this repository. Megatron Core expands upon Megatron-LM's GPU-optimized techniques with more cutting-edge innovations on system-level optimizations, featuring composable and modular APIs. - -
- -# Project Structure - -``` -Megatron-LM/ -├── megatron/ -│ ├── core/ # Megatron Core (kernels, parallelism, building blocks) -│ │ ├── models/ # Transformer models -│ │ ├── transformer/ # Transformer building blocks -│ │ ├── tensor_parallel/ # Tensor parallelism -│ │ ├── pipeline_parallel/ # Pipeline parallelism -│ │ ├── distributed/ # Distributed training (FSDP, DDP) -│ │ ├── optimizer/ # Optimizers -│ │ ├── datasets/ # Dataset loaders -│ │ ├── inference/ # Inference engines and server -│ │ └── export/ # Model export (e.g. TensorRT-LLM) -│ ├── training/ # Training scripts -│ ├── legacy/ # Legacy components -│ ├── post_training/ # Post-training (quantization, distillation, pruning, etc.) -│ └── rl/ # Reinforcement learning (RLHF, etc.) -├── examples/ # Ready-to-use training examples -├── tools/ # Utility tools -├── tests/ # Comprehensive test suite -└── docs/ # Documentation -``` - -# Performance Benchmarking - -For our latest performance benchmarking results, please refer to [NVIDIA Megatron Bridge Performance Summary](https://docs.nvidia.com/nemo/megatron-bridge/latest/performance-summary.html). - -Our codebase efficiently trains models from 2B to 462B parameters across thousands of GPUs, achieving up to **47% Model FLOP Utilization (MFU)** on H100 clusters. - -![Model table](images/model_table.png) - -**Benchmark Configuration:** - -- **Vocabulary size**: 131,072 tokens -- **Sequence length**: 4096 tokens -- **Model scaling**: Varied hidden size, attention heads, and layers to achieve target parameter counts -- **Communication optimizations**: Fine-grained overlapping with DP (`--overlap-grad-reduce`, `--overlap-param-gather`), TP (`--tp-comm-overlap`), and PP (enabled by default) - -**Key Results:** - -- **6144 H100 GPUs**: Successfully benchmarked 462B parameter model training -- **Superlinear scaling**: MFU increases from 41% to 47-48% with model size -- **End-to-end measurement**: Throughputs include all operations (data loading, optimizer steps, communication, logging) -- **Production ready**: Full training pipeline with checkpointing and fault tolerance -- *Note: Performance results measured without training to convergence* - -## Weak Scaling Results - -Our weak scaled results show superlinear scaling (MFU increases from 41% for the smallest model considered to 47-48% for the largest models); this is because larger GEMMs have higher arithmetic intensity and are consequently more efficient to execute. - -![Weak scaling](images/weak_scaling.png) - -## Strong Scaling Results - -We also strong scaled the standard GPT-3 model (our version has slightly more than 175 billion parameters due to larger vocabulary size) from 96 H100 GPUs to 4608 GPUs, using the same batch size of 1152 sequences throughout. Communication becomes more exposed at larger scale, leading to a reduction in MFU from 47% to 42%. - -![Strong scaling](images/strong_scaling.png) - -# Roadmaps - -- **[MoE Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - DeepSeek-V3, Qwen3, advanced parallelism, FP8 optimizations, and Blackwell enhancements - -# Resources - -## Getting Help - -- 📖 **[Documentation](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html)** - Official documentation -- 🐛 **[Issues](https://github.com/NVIDIA/Megatron-LM/issues)** - Bug reports and feature requests - -## Contributing - -We ❤️ contributions! Ways to contribute: - -- 🐛 **Report bugs** - Help us improve reliability -- 💡 **Suggest features** - Shape the future of Megatron Core -- 📝 **Improve docs** - Make Megatron Core more accessible -- 🔧 **Submit PRs** - Contribute code improvements - -**→ [Contributing Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - -## Citation - -If you use Megatron in your research or project, we appreciate that you use the following citations: - -```bibtex -@article{megatron-lm, - title={Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism}, - author={Shoeybi, Mohammad and Patwary, Mostofa and Puri, Raul and LeGresley, Patrick and Casper, Jared and Catanzaro, Bryan}, - journal={arXiv preprint arXiv:1909.08053}, - year={2019} -} -``` diff --git a/megatron_core.egg-info.bak/SOURCES.txt b/megatron_core.egg-info.bak/SOURCES.txt deleted file mode 100644 index 4c57cedb34b..00000000000 --- a/megatron_core.egg-info.bak/SOURCES.txt +++ /dev/null @@ -1,444 +0,0 @@ -LICENSE -MANIFEST.in -README.md -pyproject.toml -setup.py -megatron/core/README.md -megatron/core/__init__.py -megatron/core/_rank_utils.py -megatron/core/activations.py -megatron/core/config.py -megatron/core/config_logger.py -megatron/core/energy_monitor.py -megatron/core/enums.py -megatron/core/fp4_utils.py -megatron/core/fp8_utils.py -megatron/core/full_cuda_graph.py -megatron/core/hyper_comm_grid.py -megatron/core/inference_params.py -megatron/core/jit.py -megatron/core/model_parallel_config.py -megatron/core/msc_utils.py -megatron/core/nccl_allocator.py -megatron/core/num_microbatches_calculator.py -megatron/core/optimizer_param_scheduler.py -megatron/core/package_info.py -megatron/core/packed_seq_params.py -megatron/core/parallel_state.py -megatron/core/process_groups_config.py -megatron/core/requirements.txt -megatron/core/rerun_state_machine.py -megatron/core/safe_globals.py -megatron/core/timers.py -megatron/core/typed_torch.py -megatron/core/utils.py -megatron/core/datasets/__init__.py -megatron/core/datasets/bert_dataset.py -megatron/core/datasets/blended_dataset.py -megatron/core/datasets/blended_megatron_dataset_builder.py -megatron/core/datasets/blended_megatron_dataset_config.py -megatron/core/datasets/data_schedule.py -megatron/core/datasets/gpt_dataset.py -megatron/core/datasets/helpers.cpp -megatron/core/datasets/helpers.py -megatron/core/datasets/indexed_dataset.py -megatron/core/datasets/masked_dataset.py -megatron/core/datasets/megatron_dataset.py -megatron/core/datasets/multimodal_dataset.py -megatron/core/datasets/object_storage_utils.py -megatron/core/datasets/t5_dataset.py -megatron/core/datasets/utils.py -megatron/core/datasets/utils_s3.py -megatron/core/dist_checkpointing/__init__.py -megatron/core/dist_checkpointing/core.py -megatron/core/dist_checkpointing/dict_utils.py -megatron/core/dist_checkpointing/exchange_utils.py -megatron/core/dist_checkpointing/mapping.py -megatron/core/dist_checkpointing/optimizer.py -megatron/core/dist_checkpointing/serialization.py -megatron/core/dist_checkpointing/state_dict_utils.py -megatron/core/dist_checkpointing/tensor_aware_state_dict.py -megatron/core/dist_checkpointing/utils.py -megatron/core/dist_checkpointing/validation.py -megatron/core/dist_checkpointing/strategies/__init__.py -megatron/core/dist_checkpointing/strategies/async_utils.py -megatron/core/dist_checkpointing/strategies/base.py -megatron/core/dist_checkpointing/strategies/cached_metadata_filesystem_reader.py -megatron/core/dist_checkpointing/strategies/checkpointable.py -megatron/core/dist_checkpointing/strategies/common.py -megatron/core/dist_checkpointing/strategies/filesystem_async.py -megatron/core/dist_checkpointing/strategies/fully_parallel.py -megatron/core/dist_checkpointing/strategies/state_dict_saver.py -megatron/core/dist_checkpointing/strategies/torch.py -megatron/core/distributed/__init__.py -megatron/core/distributed/data_parallel_base.py -megatron/core/distributed/distributed_data_parallel.py -megatron/core/distributed/distributed_data_parallel_config.py -megatron/core/distributed/finalize_model_grads.py -megatron/core/distributed/param_and_grad_buffer.py -megatron/core/distributed/reduce_scatter_with_fp32_accumulation.py -megatron/core/distributed/torch_fully_sharded_data_parallel.py -megatron/core/distributed/torch_fully_sharded_data_parallel_config.py -megatron/core/distributed/fsdp/__init__.py -megatron/core/distributed/fsdp/mcore_fsdp_adapter.py -megatron/core/distributed/fsdp/src/__init__.py -megatron/core/distributed/fsdp/src/megatron_fsdp/__init__.py -megatron/core/distributed/fsdp/src/megatron_fsdp/distributed_data_parallel_config.py -megatron/core/distributed/fsdp/src/megatron_fsdp/fully_shard.py -megatron/core/distributed/fsdp/src/megatron_fsdp/megatron_fsdp.py -megatron/core/distributed/fsdp/src/megatron_fsdp/mixed_precision.py -megatron/core/distributed/fsdp/src/megatron_fsdp/package_info.py -megatron/core/distributed/fsdp/src/megatron_fsdp/param_and_grad_buffer.py -megatron/core/distributed/fsdp/src/megatron_fsdp/uneven_dtensor.py -megatron/core/distributed/fsdp/src/megatron_fsdp/utils.py -megatron/core/export/__init__.py -megatron/core/export/data_type.py -megatron/core/export/export_config.py -megatron/core/export/model_type.py -megatron/core/export/trtllm/__init__.py -megatron/core/export/trtllm/trt_model_config.py -megatron/core/export/trtllm/trt_model_type.py -megatron/core/export/trtllm/trtllm_helper.py -megatron/core/export/trtllm/trtllm_layers.py -megatron/core/export/trtllm/engine_builder/__init__.py -megatron/core/export/trtllm/engine_builder/trtllm_engine_builder.py -megatron/core/export/trtllm/model_to_trllm_mapping/__init__.py -megatron/core/export/trtllm/model_to_trllm_mapping/default_conversion_dict.py -megatron/core/export/trtllm/trtllm_weights_converter/__init__.py -megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py -megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py -megatron/core/export/trtllm/trtllm_weights_converter/utils.py -megatron/core/extensions/__init__.py -megatron/core/extensions/kitchen.py -megatron/core/extensions/transformer_engine.py -megatron/core/extensions/transformer_engine_spec_provider.py -megatron/core/fusions/__init__.py -megatron/core/fusions/fused_bias_dropout.py -megatron/core/fusions/fused_bias_geglu.py -megatron/core/fusions/fused_bias_gelu.py -megatron/core/fusions/fused_bias_swiglu.py -megatron/core/fusions/fused_cross_entropy.py -megatron/core/fusions/fused_indices_converter.py -megatron/core/fusions/fused_layer_norm.py -megatron/core/fusions/fused_mla_yarn_rope_apply.py -megatron/core/fusions/fused_pad_routing_map.py -megatron/core/fusions/fused_softmax.py -megatron/core/fusions/fused_weighted_squared_relu.py -megatron/core/inference/__init__.py -megatron/core/inference/async_stream.py -megatron/core/inference/batch_dimensions_utils.py -megatron/core/inference/common_inference_params.py -megatron/core/inference/communication_utils.py -megatron/core/inference/config.py -megatron/core/inference/data_parallel_inference_coordinator.py -megatron/core/inference/headers.py -megatron/core/inference/inference_client.py -megatron/core/inference/inference_request.py -megatron/core/inference/sampling_params.py -megatron/core/inference/scheduler.py -megatron/core/inference/symmetric_memory.py -megatron/core/inference/unified_memory.py -megatron/core/inference/utils.py -megatron/core/inference/communication/torch_symm_triton/__init__.py -megatron/core/inference/communication/torch_symm_triton/barrier.py -megatron/core/inference/communication/torch_symm_triton/collectives.py -megatron/core/inference/communication/torch_symm_triton/fused_collectives.py -megatron/core/inference/communication/torch_symm_triton/multimem_asm.py -megatron/core/inference/communication/torch_symm_triton/utils.py -megatron/core/inference/contexts/__init__.py -megatron/core/inference/contexts/base_context.py -megatron/core/inference/contexts/dynamic_context.py -megatron/core/inference/contexts/fused_kv_append_kernel.py -megatron/core/inference/contexts/kv_block_allocator.py -megatron/core/inference/contexts/mamba_slot_allocator.py -megatron/core/inference/contexts/routing_metadata.py -megatron/core/inference/contexts/static_context.py -megatron/core/inference/contexts/attention_context/mamba_metadata.py -megatron/core/inference/contexts/attention_context/metadata_base.py -megatron/core/inference/contexts/attention_context/mha_metadata.py -megatron/core/inference/contexts/attention_context/triton/tensor_ops.py -megatron/core/inference/engines/__init__.py -megatron/core/inference/engines/abstract_engine.py -megatron/core/inference/engines/async_zmq_communicator.py -megatron/core/inference/engines/dynamic_engine.py -megatron/core/inference/engines/mcore_engine.py -megatron/core/inference/engines/static_engine.py -megatron/core/inference/model_inference_wrappers/__init__.py -megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/gpt/__init__.py -megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/multimodal/vlm_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/t5/__init__.py -megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py -megatron/core/inference/moe/__init__.py -megatron/core/inference/moe/activations.py -megatron/core/inference/moe/fused_moe.py -megatron/core/inference/moe/pad.py -megatron/core/inference/moe/permute.py -megatron/core/inference/quantization/__init__.py -megatron/core/inference/quantization/mxfp8_quantize.py -megatron/core/inference/quantization/mxfp8_tensor.py -megatron/core/inference/quantization/utils.py -megatron/core/inference/text_generation_controllers/__init__.py -megatron/core/inference/text_generation_controllers/encoder_decoder_text_generation_controller.py -megatron/core/inference/text_generation_controllers/text_generation_controller.py -megatron/core/inference/text_generation_controllers/vlm_text_generation_controller.py -megatron/core/inference/text_generation_server/__init__.py -megatron/core/inference/text_generation_server/run_mcore_engine.py -megatron/core/inference/text_generation_server/text_generation_server.py -megatron/core/inference/text_generation_server/tokenization.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/__init__.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/text_generation_server.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/tokenization.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/__init__.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/chat_completions.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/common.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/completions.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/health.py -megatron/core/inference/text_generation_server/endpoints/common.py -megatron/core/inference/text_generation_server/endpoints/completions.py -megatron/core/models/__init__.py -megatron/core/models/backends.py -megatron/core/models/T5/__init__.py -megatron/core/models/T5/t5_model.py -megatron/core/models/T5/t5_spec.py -megatron/core/models/bert/__init__.py -megatron/core/models/bert/bert_layer_specs.py -megatron/core/models/bert/bert_lm_head.py -megatron/core/models/bert/bert_model.py -megatron/core/models/bert/pooler.py -megatron/core/models/common/__init__.py -megatron/core/models/common/model_chunk_schedule_plan.py -megatron/core/models/common/embeddings/__init__.py -megatron/core/models/common/embeddings/language_model_embedding.py -megatron/core/models/common/embeddings/relative_pos_embedding.py -megatron/core/models/common/embeddings/rope_utils.py -megatron/core/models/common/embeddings/rotary_pos_embedding.py -megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py -megatron/core/models/common/language_module/__init__.py -megatron/core/models/common/language_module/language_module.py -megatron/core/models/common/vision_module/__init__.py -megatron/core/models/common/vision_module/vision_module.py -megatron/core/models/gpt/__init__.py -megatron/core/models/gpt/experimental_attention_variant_module_specs.py -megatron/core/models/gpt/fine_grained_callables.py -megatron/core/models/gpt/gpt_layer_specs.py -megatron/core/models/gpt/gpt_model.py -megatron/core/models/gpt/moe_module_specs.py -megatron/core/models/gpt/heterogeneous/heterogeneous_layer_specs.py -megatron/core/models/huggingface/__init__.py -megatron/core/models/huggingface/clip_model.py -megatron/core/models/huggingface/module.py -megatron/core/models/huggingface/qwen_model.py -megatron/core/models/mamba/__init__.py -megatron/core/models/mamba/mamba_layer_specs.py -megatron/core/models/mamba/mamba_model.py -megatron/core/models/mimo/__init__.py -megatron/core/models/mimo/optimizer.py -megatron/core/models/mimo/config/__init__.py -megatron/core/models/mimo/config/base_configs.py -megatron/core/models/mimo/config/role.py -megatron/core/models/mimo/model/__init__.py -megatron/core/models/mimo/model/base.py -megatron/core/models/mimo/partition/utils.py -megatron/core/models/mimo/submodules/audio.py -megatron/core/models/mimo/submodules/base.py -megatron/core/models/mimo/submodules/vision.py -megatron/core/models/multimodal/__init__.py -megatron/core/models/multimodal/context_parallel.py -megatron/core/models/multimodal/llava_model.py -megatron/core/models/multimodal/llava_spec.py -megatron/core/models/vision/__init__.py -megatron/core/models/vision/clip_vit_model.py -megatron/core/models/vision/multimodal_projector.py -megatron/core/models/vision/radio.py -megatron/core/models/vision/vit_layer_specs.py -megatron/core/optimizer/__init__.py -megatron/core/optimizer/clip_grads.py -megatron/core/optimizer/distrib_optimizer.py -megatron/core/optimizer/emerging_optimizers.py -megatron/core/optimizer/grad_scaler.py -megatron/core/optimizer/layer_wise_optimizer.py -megatron/core/optimizer/muon.py -megatron/core/optimizer/optimizer.py -megatron/core/optimizer/optimizer_config.py -megatron/core/optimizer/optimizer_cuda_graph.py -megatron/core/optimizer/qk_clip.py -megatron/core/optimizer/cpu_offloading/__init__.py -megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py -megatron/core/pipeline_parallel/__init__.py -megatron/core/pipeline_parallel/bridge_communicator.py -megatron/core/pipeline_parallel/combined_1f1b.py -megatron/core/pipeline_parallel/fine_grained_activation_offload.py -megatron/core/pipeline_parallel/hybrid_cp_schedule.py -megatron/core/pipeline_parallel/multimodule_communicator.py -megatron/core/pipeline_parallel/p2p_communication.py -megatron/core/pipeline_parallel/schedules.py -megatron/core/pipeline_parallel/utils.py -megatron/core/post_training/__init__.py -megatron/core/post_training/modelopt/__init__.py -megatron/core/post_training/modelopt/layers.py -megatron/core/post_training/modelopt/gpt/__init__.py -megatron/core/post_training/modelopt/gpt/model_specs.py -megatron/core/post_training/modelopt/gpt/state_dict_hooks.py -megatron/core/post_training/modelopt/mamba/__init__.py -megatron/core/post_training/modelopt/mamba/model_specs.py -megatron/core/quantization/__init__.py -megatron/core/quantization/quant_config.py -megatron/core/quantization/utils.py -megatron/core/resharding/__init__.py -megatron/core/resharding/execution.py -megatron/core/resharding/planner.py -megatron/core/resharding/refit.py -megatron/core/resharding/transforms.py -megatron/core/resharding/utils.py -megatron/core/resharding/copy_services/__init__.py -megatron/core/resharding/copy_services/base.py -megatron/core/resharding/copy_services/gloo_copy_service.py -megatron/core/resharding/copy_services/nccl_copy_service.py -megatron/core/resharding/copy_services/nvshmem_copy_service.py -megatron/core/resharding/nvshmem_copy_service/__init__.py -megatron/core/resharding/nvshmem_copy_service/compat.py -megatron/core/resharding/nvshmem_copy_service/logger.py -megatron/core/resharding/nvshmem_copy_service/nvshmem_types.py -megatron/core/resharding/nvshmem_copy_service/service.py -megatron/core/resharding/nvshmem_copy_service/validation.py -megatron/core/resharding/nvshmem_copy_service/core/__init__.py -megatron/core/resharding/nvshmem_copy_service/core/gpu_resource_manager.py -megatron/core/resharding/nvshmem_copy_service/core/kernel_launcher.py -megatron/core/resharding/nvshmem_copy_service/core/pipeline_executor.py -megatron/core/resharding/nvshmem_copy_service/memory/__init__.py -megatron/core/resharding/nvshmem_copy_service/memory/double_buffer_manager.py -megatron/core/resharding/nvshmem_copy_service/memory/tensor_pointer_utils.py -megatron/core/resharding/nvshmem_copy_service/planning/__init__.py -megatron/core/resharding/nvshmem_copy_service/planning/communication_scheduler.py -megatron/core/resharding/nvshmem_copy_service/planning/gpu_execution_planner.py -megatron/core/resharding/nvshmem_copy_service/planning/task_segmenter.py -megatron/core/resharding/nvshmem_copy_service/planning/workload_packer.py -megatron/core/ssm/__init__.py -megatron/core/ssm/gated_delta_net.py -megatron/core/ssm/mamba_block.py -megatron/core/ssm/mamba_context_parallel.py -megatron/core/ssm/mamba_hybrid_layer_allocation.py -megatron/core/ssm/mamba_layer.py -megatron/core/ssm/mamba_mixer.py -megatron/core/ssm/mlp_layer.py -megatron/core/ssm/triton_cache_manager.py -megatron/core/ssm/ops/__init__.py -megatron/core/ssm/ops/causal_conv1d_triton.py -megatron/core/ssm/ops/causal_conv1d_varlen.py -megatron/core/ssm/ops/determinism.py -megatron/core/ssm/ops/mamba_ssm.py -megatron/core/ssm/ops/ssd_bmm.py -megatron/core/ssm/ops/ssd_chunk_scan.py -megatron/core/ssm/ops/ssd_chunk_state.py -megatron/core/ssm/ops/ssd_combined.py -megatron/core/ssm/ops/ssd_state_passing.py -megatron/core/tensor_parallel/__init__.py -megatron/core/tensor_parallel/cross_entropy.py -megatron/core/tensor_parallel/data.py -megatron/core/tensor_parallel/inference_layers.py -megatron/core/tensor_parallel/layers.py -megatron/core/tensor_parallel/mappings.py -megatron/core/tensor_parallel/random.py -megatron/core/tensor_parallel/utils.py -megatron/core/tokenizers/__init__.py -megatron/core/tokenizers/base_tokenizer.py -megatron/core/tokenizers/megatron_tokenizer.py -megatron/core/tokenizers/text/__init__.py -megatron/core/tokenizers/text/text_tokenizer.py -megatron/core/tokenizers/text/libraries/__init__.py -megatron/core/tokenizers/text/libraries/abstract_tokenizer.py -megatron/core/tokenizers/text/libraries/bytelevel_tokenizer.py -megatron/core/tokenizers/text/libraries/chat_template.py -megatron/core/tokenizers/text/libraries/huggingface_tokenizer.py -megatron/core/tokenizers/text/libraries/megatron_hf_tokenizer.py -megatron/core/tokenizers/text/libraries/null_tokenizer.py -megatron/core/tokenizers/text/libraries/sentencepiece_tokenizer.py -megatron/core/tokenizers/text/libraries/sft_tokenizer.py -megatron/core/tokenizers/text/libraries/tiktoken_tokenizer.py -megatron/core/tokenizers/text/models/__init__.py -megatron/core/tokenizers/text/models/bert_tokenizer.py -megatron/core/tokenizers/text/models/default_tokenizer.py -megatron/core/tokenizers/text/models/gpt_tokenizer.py -megatron/core/tokenizers/text/models/mamba_tokenizer.py -megatron/core/tokenizers/text/models/t5_tokenizer.py -megatron/core/tokenizers/text/parsers/__init__.py -megatron/core/tokenizers/text/parsers/base_parser.py -megatron/core/tokenizers/text/parsers/deepseek_r1_reasoning_parser.py -megatron/core/tokenizers/text/parsers/qwen3_coder_tool_parser.py -megatron/core/tokenizers/utils/build_tokenizer.py -megatron/core/tokenizers/vision/__init__.py -megatron/core/tokenizers/vision/vision_tokenizer.py -megatron/core/tokenizers/vision/libraries/__init__.py -megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py -megatron/core/tokenizers/vision/libraries/null_multimodal_tokenizer.py -megatron/core/tokenizers/vision/models/__init__.py -megatron/core/tokenizers/vision/models/default_tokenizer.py -megatron/core/transformer/__init__.py -megatron/core/transformer/attention.py -megatron/core/transformer/cuda_graphs.py -megatron/core/transformer/dot_product_attention.py -megatron/core/transformer/enums.py -megatron/core/transformer/fsdp_dtensor_checkpoint.py -megatron/core/transformer/identity_op.py -megatron/core/transformer/mlp.py -megatron/core/transformer/module.py -megatron/core/transformer/multi_latent_attention.py -megatron/core/transformer/multi_token_prediction.py -megatron/core/transformer/pipeline_parallel_layer_layout.py -megatron/core/transformer/spec_utils.py -megatron/core/transformer/torch_layer_norm.py -megatron/core/transformer/torch_norm.py -megatron/core/transformer/transformer_block.py -megatron/core/transformer/transformer_config.py -megatron/core/transformer/transformer_layer.py -megatron/core/transformer/utils.py -megatron/core/transformer/custom_layers/__init__.py -megatron/core/transformer/custom_layers/batch_invariant_kernels.py -megatron/core/transformer/experimental_attention_variant/absorbed_mla.py -megatron/core/transformer/experimental_attention_variant/dsa.py -megatron/core/transformer/heterogeneous/heterogeneous_config.py -megatron/core/transformer/heterogeneous/linear_replacements.py -megatron/core/transformer/moe/__init__.py -megatron/core/transformer/moe/experts.py -megatron/core/transformer/moe/fused_a2a.py -megatron/core/transformer/moe/moe_layer.py -megatron/core/transformer/moe/moe_utils.py -megatron/core/transformer/moe/router.py -megatron/core/transformer/moe/router_replay.py -megatron/core/transformer/moe/shared_experts.py -megatron/core/transformer/moe/token_dispatcher.py -megatron/core/transformer/moe/token_dispatcher_inference.py -megatron/core/transformer/moe/upcycling_utils.py -megatron/training/__init__.py -megatron/training/argument_utils.py -megatron/training/arguments.py -megatron/training/async_utils.py -megatron/training/checkpointing.py -megatron/training/dgrad_logging.py -megatron/training/dist_signal_handler.py -megatron/training/ft_integration.py -megatron/training/global_vars.py -megatron/training/initialize.py -megatron/training/inprocess_restart.py -megatron/training/log_handler.py -megatron/training/one_logger_utils.py -megatron/training/theoretical_memory_usage.py -megatron/training/training.py -megatron/training/utils.py -megatron/training/wandb_utils.py -megatron/training/yaml_arguments.py -megatron/training/config/__init__.py -megatron/training/config/common_config.py -megatron/training/config/resilience_config.py -megatron/training/config/training_config.py -megatron/training/datasets/__init__.py -megatron/training/datasets/data_samplers.py -megatron/training/datasets/fim_dataset.py -megatron/training/datasets/sft_dataset.py -megatron_core.egg-info/PKG-INFO -megatron_core.egg-info/SOURCES.txt -megatron_core.egg-info/dependency_links.txt -megatron_core.egg-info/requires.txt -megatron_core.egg-info/top_level.txt \ No newline at end of file diff --git a/megatron_core.egg-info.bak/dependency_links.txt b/megatron_core.egg-info.bak/dependency_links.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/megatron_core.egg-info.bak/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/megatron_core.egg-info.bak/requires.txt b/megatron_core.egg-info.bak/requires.txt deleted file mode 100644 index 50312bd5967..00000000000 --- a/megatron_core.egg-info.bak/requires.txt +++ /dev/null @@ -1,65 +0,0 @@ -torch>=2.6.0 -numpy -packaging>=24.2 - -[dev] -transformer-engine[core_cu13,pytorch] -nvidia-resiliency-ext -tqdm -einops~=0.8 -tensorstore!=0.1.46,!=0.1.72,~=0.1 -nvtx~=0.2 -multi-storage-client~=0.27 -opentelemetry-api~=1.33.1 -mamba-ssm~=2.2 -causal-conv1d~=1.5 -flash-linear-attention~=0.4.0 -megatron-energon[av_decode]~=6.0 -av -flashinfer-python~=0.5.0 -wget -onnxscript -fastapi~=0.50 -datasets -emerging_optimizers -hypercorn -quart -openai[aiohttp] -orjson - -[dev:sys_platform != "darwin"] -nvidia-modelopt[torch] - -[lts] -tqdm -einops~=0.8 -tensorstore!=0.1.46,!=0.1.72,~=0.1 -nvtx~=0.2 -multi-storage-client~=0.27 -opentelemetry-api~=1.33.1 -mamba-ssm~=2.2 -causal-conv1d~=1.5 -megatron-energon[av_decode]~=6.0 -av -flashinfer-python~=0.5.0 -wget -onnxscript -fastapi~=0.50 -datasets -emerging_optimizers - -[mlm] -flask-restful -sentencepiece -tiktoken -wandb -transformers -accelerate - -[training] -flask-restful -sentencepiece -tiktoken -wandb -transformers -accelerate diff --git a/megatron_core.egg-info.bak/top_level.txt b/megatron_core.egg-info.bak/top_level.txt deleted file mode 100644 index 3bfbb11f4a7..00000000000 --- a/megatron_core.egg-info.bak/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -megatron From dfd187e99e20ae016fd6c6553b11c4a1124dd010 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 07:33:19 -0700 Subject: [PATCH 07/12] upgrade transformers Signed-off-by: dimapihtar --- examples/multimodal/Dockerfile | 2 +- megatron_core.egg-info.bak/PKG-INFO | 255 ++++++++++ megatron_core.egg-info.bak/SOURCES.txt | 444 ++++++++++++++++++ .../dependency_links.txt | 1 + megatron_core.egg-info.bak/requires.txt | 65 +++ megatron_core.egg-info.bak/top_level.txt | 1 + uv.lock | 208 ++------ 7 files changed, 819 insertions(+), 157 deletions(-) create mode 100644 megatron_core.egg-info.bak/PKG-INFO create mode 100644 megatron_core.egg-info.bak/SOURCES.txt create mode 100644 megatron_core.egg-info.bak/dependency_links.txt create mode 100644 megatron_core.egg-info.bak/requires.txt create mode 100644 megatron_core.egg-info.bak/top_level.txt diff --git a/examples/multimodal/Dockerfile b/examples/multimodal/Dockerfile index d7c4fd41af5..4ed66900179 100644 --- a/examples/multimodal/Dockerfile +++ b/examples/multimodal/Dockerfile @@ -16,7 +16,7 @@ RUN uv pip install --system --no-cache --break-system-packages \ braceexpand \ webdataset \ packaging \ - "transformers<5.0.0" \ + transformers \ datasets \ accelerate \ timm \ diff --git a/megatron_core.egg-info.bak/PKG-INFO b/megatron_core.egg-info.bak/PKG-INFO new file mode 100644 index 00000000000..05bbfded449 --- /dev/null +++ b/megatron_core.egg-info.bak/PKG-INFO @@ -0,0 +1,255 @@ +Metadata-Version: 2.4 +Name: megatron-core +Version: 0.18.0rc0 +Summary: Megatron Core - a library for efficient and scalable training of transformer based models +Author-email: NVIDIA +Maintainer-email: NVIDIA +License: Apache 2.0 +Project-URL: Download, https://github.com/NVIDIA/Megatron-LM/releases +Project-URL: Homepage, https://github.com/NVIDIA/Megatron-LM +Keywords: NLP,NLU,deep,gpu,language,learning,machine,nvidia,pytorch,torch,transformer +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Natural Language :: English +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence +Classifier: Topic :: Scientific/Engineering :: Image Recognition +Classifier: Topic :: Scientific/Engineering :: Mathematics +Classifier: Topic :: Scientific/Engineering +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Utilities +Requires-Python: >=3.12 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: torch>=2.6.0 +Requires-Dist: numpy +Requires-Dist: packaging>=24.2 +Provides-Extra: training +Requires-Dist: flask-restful; extra == "training" +Requires-Dist: sentencepiece; extra == "training" +Requires-Dist: tiktoken; extra == "training" +Requires-Dist: wandb; extra == "training" +Requires-Dist: transformers; extra == "training" +Requires-Dist: accelerate; extra == "training" +Provides-Extra: mlm +Requires-Dist: flask-restful; extra == "mlm" +Requires-Dist: sentencepiece; extra == "mlm" +Requires-Dist: tiktoken; extra == "mlm" +Requires-Dist: wandb; extra == "mlm" +Requires-Dist: transformers; extra == "mlm" +Requires-Dist: accelerate; extra == "mlm" +Provides-Extra: dev +Requires-Dist: nvidia-modelopt[torch]; sys_platform != "darwin" and extra == "dev" +Requires-Dist: transformer-engine[core_cu13,pytorch]; extra == "dev" +Requires-Dist: nvidia-resiliency-ext; extra == "dev" +Requires-Dist: tqdm; extra == "dev" +Requires-Dist: einops~=0.8; extra == "dev" +Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "dev" +Requires-Dist: nvtx~=0.2; extra == "dev" +Requires-Dist: multi-storage-client~=0.27; extra == "dev" +Requires-Dist: opentelemetry-api~=1.33.1; extra == "dev" +Requires-Dist: mamba-ssm~=2.2; extra == "dev" +Requires-Dist: causal-conv1d~=1.5; extra == "dev" +Requires-Dist: flash-linear-attention~=0.4.0; extra == "dev" +Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "dev" +Requires-Dist: av; extra == "dev" +Requires-Dist: flashinfer-python~=0.5.0; extra == "dev" +Requires-Dist: wget; extra == "dev" +Requires-Dist: onnxscript; extra == "dev" +Requires-Dist: fastapi~=0.50; extra == "dev" +Requires-Dist: datasets; extra == "dev" +Requires-Dist: emerging_optimizers; extra == "dev" +Requires-Dist: hypercorn; extra == "dev" +Requires-Dist: quart; extra == "dev" +Requires-Dist: openai[aiohttp]; extra == "dev" +Requires-Dist: orjson; extra == "dev" +Provides-Extra: lts +Requires-Dist: tqdm; extra == "lts" +Requires-Dist: einops~=0.8; extra == "lts" +Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "lts" +Requires-Dist: nvtx~=0.2; extra == "lts" +Requires-Dist: multi-storage-client~=0.27; extra == "lts" +Requires-Dist: opentelemetry-api~=1.33.1; extra == "lts" +Requires-Dist: mamba-ssm~=2.2; extra == "lts" +Requires-Dist: causal-conv1d~=1.5; extra == "lts" +Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "lts" +Requires-Dist: av; extra == "lts" +Requires-Dist: flashinfer-python~=0.5.0; extra == "lts" +Requires-Dist: wget; extra == "lts" +Requires-Dist: onnxscript; extra == "lts" +Requires-Dist: fastapi~=0.50; extra == "lts" +Requires-Dist: datasets; extra == "lts" +Requires-Dist: emerging_optimizers; extra == "lts" +Dynamic: license-file + +
+ +Megatron-LM and Megatron Core +============================= + +

GPU-optimized library for training transformer models at scale

+ +[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html) +[![version](https://img.shields.io/badge/release-0.15.0-green)](./CHANGELOG.md) +[![license](https://img.shields.io/badge/license-Apache-blue)](./LICENSE) + +
+ +## About + +This repository contains two components: **Megatron-LM** and **Megatron Core**. + +**Megatron-LM** is a reference example that includes Megatron Core plus pre-configured training scripts. Best for research teams, learning distributed training, and quick experimentation. + +**Megatron Core** is a composable library with GPU-optimized building blocks for custom training frameworks. It provides transformer building blocks, advanced parallelism strategies (TP, PP, DP, EP, CP), mixed precision support (FP16, BF16, FP8, FP4), and model architectures. Best for framework developers and ML engineers building custom training pipelines. + +**[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** provides bidirectional Hugging Face ↔ Megatron checkpoint conversion with production-ready recipes. + +## Getting Started + +**Install from PyPI:** + +```bash +uv pip install megatron-core +``` + +**Or clone and install from source:** + +```bash +git clone https://github.com/NVIDIA/Megatron-LM.git +cd Megatron-LM +uv pip install -e . +``` + +> **Note:** Building from source can use a lot of memory. If the build runs out of memory, limit parallel compilation jobs by setting `MAX_JOBS` (e.g. `MAX_JOBS=4 uv pip install -e .`). + +For NGC container setup and all installation options, see the **[Installation Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/install.html)**. + +- **[Your First Training Run](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/quickstart.html)** - End-to-end training examples with data preparation +- **[Parallelism Strategies](https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/parallelism-guide.html)** - Scale training across GPUs with TP, PP, DP, EP, and CP +- **[Contribution Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - How to contribute to Megatron Core + +# Latest News + +- **[2026/03]** **Deprecating Python 3.10 support:** We're officially dropping Python 3.10 support with the upcoming 0.17.0 release. Downstream applications must raise their lower boundary to 3.12 to stay compatible with MCore. +- **[2026/01]** **[Dynamic Context Parallelism](https://developer.nvidia.com/blog/speeding-up-variable-length-training-with-dynamic-context-parallelism-and-nvidia-megatron-core/)** - Up to 1.48x speedup for variable-length sequence training with adaptive CP sizing. +- **[2025/12]** **Megatron Core development has moved to GitHub!** All development and CI now happens in the open. We welcome community contributions. +- **[2025/10]** **[Megatron Dev Branch](https://github.com/NVIDIA/Megatron-LM/tree/dev)** - early access branch with experimental features. +- **[2025/10]** **[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** - Bidirectional converter for interoperability between Hugging Face and Megatron checkpoints, featuring production-ready recipes for popular models. +- **[2025/08]** **[MoE Q3-Q4 2025 Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - Comprehensive roadmap for MoE features including DeepSeek-V3, Qwen3, advanced parallelism strategies, FP8 optimizations, and Blackwell performance enhancements. +- **[2025/08]** **[GPT-OSS Model](https://github.com/NVIDIA/Megatron-LM/issues/1739)** - Advanced features including YaRN RoPE scaling, attention sinks, and custom activation functions are being integrated into Megatron Core. +- **[2025/06]** **[Megatron MoE Model Zoo](https://github.com/yanring/Megatron-MoE-ModelZoo)** - Best practices and optimized configurations for training DeepSeek-V3, Mixtral, and Qwen3 MoE models with performance benchmarking and checkpoint conversion tools. +- **[2025/05]** Megatron Core v0.11.0 brings new capabilities for multi-data center LLM training ([blog](https://developer.nvidia.com/blog/turbocharge-llm-training-across-long-haul-data-center-networks-with-nvidia-nemo-framework/)). + +
+Previous News + +- **[2024/07]** Megatron Core v0.7 improves scalability and training resiliency and adds support for multimodal training ([blog](https://developer.nvidia.com/blog/train-generative-ai-models-more-efficiently-with-new-nvidia-Megatron-Core-functionalities/)). +- **[2024/06]** Megatron Core added supports for Mamba-based models. Check out our paper [An Empirical Study of Mamba-based Language Models](https://arxiv.org/pdf/2406.07887) and [code example](https://github.com/NVIDIA/Megatron-LM/tree/ssm/examples/mamba). +- **[2024/01 Announcement]** NVIDIA has released the core capabilities in **Megatron-LM** into [**Megatron Core**](https://github.com/NVIDIA/Megatron-LM/tree/main/megatron/core) in this repository. Megatron Core expands upon Megatron-LM's GPU-optimized techniques with more cutting-edge innovations on system-level optimizations, featuring composable and modular APIs. + +
+ +# Project Structure + +``` +Megatron-LM/ +├── megatron/ +│ ├── core/ # Megatron Core (kernels, parallelism, building blocks) +│ │ ├── models/ # Transformer models +│ │ ├── transformer/ # Transformer building blocks +│ │ ├── tensor_parallel/ # Tensor parallelism +│ │ ├── pipeline_parallel/ # Pipeline parallelism +│ │ ├── distributed/ # Distributed training (FSDP, DDP) +│ │ ├── optimizer/ # Optimizers +│ │ ├── datasets/ # Dataset loaders +│ │ ├── inference/ # Inference engines and server +│ │ └── export/ # Model export (e.g. TensorRT-LLM) +│ ├── training/ # Training scripts +│ ├── legacy/ # Legacy components +│ ├── post_training/ # Post-training (quantization, distillation, pruning, etc.) +│ └── rl/ # Reinforcement learning (RLHF, etc.) +├── examples/ # Ready-to-use training examples +├── tools/ # Utility tools +├── tests/ # Comprehensive test suite +└── docs/ # Documentation +``` + +# Performance Benchmarking + +For our latest performance benchmarking results, please refer to [NVIDIA Megatron Bridge Performance Summary](https://docs.nvidia.com/nemo/megatron-bridge/latest/performance-summary.html). + +Our codebase efficiently trains models from 2B to 462B parameters across thousands of GPUs, achieving up to **47% Model FLOP Utilization (MFU)** on H100 clusters. + +![Model table](images/model_table.png) + +**Benchmark Configuration:** + +- **Vocabulary size**: 131,072 tokens +- **Sequence length**: 4096 tokens +- **Model scaling**: Varied hidden size, attention heads, and layers to achieve target parameter counts +- **Communication optimizations**: Fine-grained overlapping with DP (`--overlap-grad-reduce`, `--overlap-param-gather`), TP (`--tp-comm-overlap`), and PP (enabled by default) + +**Key Results:** + +- **6144 H100 GPUs**: Successfully benchmarked 462B parameter model training +- **Superlinear scaling**: MFU increases from 41% to 47-48% with model size +- **End-to-end measurement**: Throughputs include all operations (data loading, optimizer steps, communication, logging) +- **Production ready**: Full training pipeline with checkpointing and fault tolerance +- *Note: Performance results measured without training to convergence* + +## Weak Scaling Results + +Our weak scaled results show superlinear scaling (MFU increases from 41% for the smallest model considered to 47-48% for the largest models); this is because larger GEMMs have higher arithmetic intensity and are consequently more efficient to execute. + +![Weak scaling](images/weak_scaling.png) + +## Strong Scaling Results + +We also strong scaled the standard GPT-3 model (our version has slightly more than 175 billion parameters due to larger vocabulary size) from 96 H100 GPUs to 4608 GPUs, using the same batch size of 1152 sequences throughout. Communication becomes more exposed at larger scale, leading to a reduction in MFU from 47% to 42%. + +![Strong scaling](images/strong_scaling.png) + +# Roadmaps + +- **[MoE Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - DeepSeek-V3, Qwen3, advanced parallelism, FP8 optimizations, and Blackwell enhancements + +# Resources + +## Getting Help + +- 📖 **[Documentation](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html)** - Official documentation +- 🐛 **[Issues](https://github.com/NVIDIA/Megatron-LM/issues)** - Bug reports and feature requests + +## Contributing + +We ❤️ contributions! Ways to contribute: + +- 🐛 **Report bugs** - Help us improve reliability +- 💡 **Suggest features** - Shape the future of Megatron Core +- 📝 **Improve docs** - Make Megatron Core more accessible +- 🔧 **Submit PRs** - Contribute code improvements + +**→ [Contributing Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** + +## Citation + +If you use Megatron in your research or project, we appreciate that you use the following citations: + +```bibtex +@article{megatron-lm, + title={Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism}, + author={Shoeybi, Mohammad and Patwary, Mostofa and Puri, Raul and LeGresley, Patrick and Casper, Jared and Catanzaro, Bryan}, + journal={arXiv preprint arXiv:1909.08053}, + year={2019} +} +``` diff --git a/megatron_core.egg-info.bak/SOURCES.txt b/megatron_core.egg-info.bak/SOURCES.txt new file mode 100644 index 00000000000..4c57cedb34b --- /dev/null +++ b/megatron_core.egg-info.bak/SOURCES.txt @@ -0,0 +1,444 @@ +LICENSE +MANIFEST.in +README.md +pyproject.toml +setup.py +megatron/core/README.md +megatron/core/__init__.py +megatron/core/_rank_utils.py +megatron/core/activations.py +megatron/core/config.py +megatron/core/config_logger.py +megatron/core/energy_monitor.py +megatron/core/enums.py +megatron/core/fp4_utils.py +megatron/core/fp8_utils.py +megatron/core/full_cuda_graph.py +megatron/core/hyper_comm_grid.py +megatron/core/inference_params.py +megatron/core/jit.py +megatron/core/model_parallel_config.py +megatron/core/msc_utils.py +megatron/core/nccl_allocator.py +megatron/core/num_microbatches_calculator.py +megatron/core/optimizer_param_scheduler.py +megatron/core/package_info.py +megatron/core/packed_seq_params.py +megatron/core/parallel_state.py +megatron/core/process_groups_config.py +megatron/core/requirements.txt +megatron/core/rerun_state_machine.py +megatron/core/safe_globals.py +megatron/core/timers.py +megatron/core/typed_torch.py +megatron/core/utils.py +megatron/core/datasets/__init__.py +megatron/core/datasets/bert_dataset.py +megatron/core/datasets/blended_dataset.py +megatron/core/datasets/blended_megatron_dataset_builder.py +megatron/core/datasets/blended_megatron_dataset_config.py +megatron/core/datasets/data_schedule.py +megatron/core/datasets/gpt_dataset.py +megatron/core/datasets/helpers.cpp +megatron/core/datasets/helpers.py +megatron/core/datasets/indexed_dataset.py +megatron/core/datasets/masked_dataset.py +megatron/core/datasets/megatron_dataset.py +megatron/core/datasets/multimodal_dataset.py +megatron/core/datasets/object_storage_utils.py +megatron/core/datasets/t5_dataset.py +megatron/core/datasets/utils.py +megatron/core/datasets/utils_s3.py +megatron/core/dist_checkpointing/__init__.py +megatron/core/dist_checkpointing/core.py +megatron/core/dist_checkpointing/dict_utils.py +megatron/core/dist_checkpointing/exchange_utils.py +megatron/core/dist_checkpointing/mapping.py +megatron/core/dist_checkpointing/optimizer.py +megatron/core/dist_checkpointing/serialization.py +megatron/core/dist_checkpointing/state_dict_utils.py +megatron/core/dist_checkpointing/tensor_aware_state_dict.py +megatron/core/dist_checkpointing/utils.py +megatron/core/dist_checkpointing/validation.py +megatron/core/dist_checkpointing/strategies/__init__.py +megatron/core/dist_checkpointing/strategies/async_utils.py +megatron/core/dist_checkpointing/strategies/base.py +megatron/core/dist_checkpointing/strategies/cached_metadata_filesystem_reader.py +megatron/core/dist_checkpointing/strategies/checkpointable.py +megatron/core/dist_checkpointing/strategies/common.py +megatron/core/dist_checkpointing/strategies/filesystem_async.py +megatron/core/dist_checkpointing/strategies/fully_parallel.py +megatron/core/dist_checkpointing/strategies/state_dict_saver.py +megatron/core/dist_checkpointing/strategies/torch.py +megatron/core/distributed/__init__.py +megatron/core/distributed/data_parallel_base.py +megatron/core/distributed/distributed_data_parallel.py +megatron/core/distributed/distributed_data_parallel_config.py +megatron/core/distributed/finalize_model_grads.py +megatron/core/distributed/param_and_grad_buffer.py +megatron/core/distributed/reduce_scatter_with_fp32_accumulation.py +megatron/core/distributed/torch_fully_sharded_data_parallel.py +megatron/core/distributed/torch_fully_sharded_data_parallel_config.py +megatron/core/distributed/fsdp/__init__.py +megatron/core/distributed/fsdp/mcore_fsdp_adapter.py +megatron/core/distributed/fsdp/src/__init__.py +megatron/core/distributed/fsdp/src/megatron_fsdp/__init__.py +megatron/core/distributed/fsdp/src/megatron_fsdp/distributed_data_parallel_config.py +megatron/core/distributed/fsdp/src/megatron_fsdp/fully_shard.py +megatron/core/distributed/fsdp/src/megatron_fsdp/megatron_fsdp.py +megatron/core/distributed/fsdp/src/megatron_fsdp/mixed_precision.py +megatron/core/distributed/fsdp/src/megatron_fsdp/package_info.py +megatron/core/distributed/fsdp/src/megatron_fsdp/param_and_grad_buffer.py +megatron/core/distributed/fsdp/src/megatron_fsdp/uneven_dtensor.py +megatron/core/distributed/fsdp/src/megatron_fsdp/utils.py +megatron/core/export/__init__.py +megatron/core/export/data_type.py +megatron/core/export/export_config.py +megatron/core/export/model_type.py +megatron/core/export/trtllm/__init__.py +megatron/core/export/trtllm/trt_model_config.py +megatron/core/export/trtllm/trt_model_type.py +megatron/core/export/trtllm/trtllm_helper.py +megatron/core/export/trtllm/trtllm_layers.py +megatron/core/export/trtllm/engine_builder/__init__.py +megatron/core/export/trtllm/engine_builder/trtllm_engine_builder.py +megatron/core/export/trtllm/model_to_trllm_mapping/__init__.py +megatron/core/export/trtllm/model_to_trllm_mapping/default_conversion_dict.py +megatron/core/export/trtllm/trtllm_weights_converter/__init__.py +megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py +megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py +megatron/core/export/trtllm/trtllm_weights_converter/utils.py +megatron/core/extensions/__init__.py +megatron/core/extensions/kitchen.py +megatron/core/extensions/transformer_engine.py +megatron/core/extensions/transformer_engine_spec_provider.py +megatron/core/fusions/__init__.py +megatron/core/fusions/fused_bias_dropout.py +megatron/core/fusions/fused_bias_geglu.py +megatron/core/fusions/fused_bias_gelu.py +megatron/core/fusions/fused_bias_swiglu.py +megatron/core/fusions/fused_cross_entropy.py +megatron/core/fusions/fused_indices_converter.py +megatron/core/fusions/fused_layer_norm.py +megatron/core/fusions/fused_mla_yarn_rope_apply.py +megatron/core/fusions/fused_pad_routing_map.py +megatron/core/fusions/fused_softmax.py +megatron/core/fusions/fused_weighted_squared_relu.py +megatron/core/inference/__init__.py +megatron/core/inference/async_stream.py +megatron/core/inference/batch_dimensions_utils.py +megatron/core/inference/common_inference_params.py +megatron/core/inference/communication_utils.py +megatron/core/inference/config.py +megatron/core/inference/data_parallel_inference_coordinator.py +megatron/core/inference/headers.py +megatron/core/inference/inference_client.py +megatron/core/inference/inference_request.py +megatron/core/inference/sampling_params.py +megatron/core/inference/scheduler.py +megatron/core/inference/symmetric_memory.py +megatron/core/inference/unified_memory.py +megatron/core/inference/utils.py +megatron/core/inference/communication/torch_symm_triton/__init__.py +megatron/core/inference/communication/torch_symm_triton/barrier.py +megatron/core/inference/communication/torch_symm_triton/collectives.py +megatron/core/inference/communication/torch_symm_triton/fused_collectives.py +megatron/core/inference/communication/torch_symm_triton/multimem_asm.py +megatron/core/inference/communication/torch_symm_triton/utils.py +megatron/core/inference/contexts/__init__.py +megatron/core/inference/contexts/base_context.py +megatron/core/inference/contexts/dynamic_context.py +megatron/core/inference/contexts/fused_kv_append_kernel.py +megatron/core/inference/contexts/kv_block_allocator.py +megatron/core/inference/contexts/mamba_slot_allocator.py +megatron/core/inference/contexts/routing_metadata.py +megatron/core/inference/contexts/static_context.py +megatron/core/inference/contexts/attention_context/mamba_metadata.py +megatron/core/inference/contexts/attention_context/metadata_base.py +megatron/core/inference/contexts/attention_context/mha_metadata.py +megatron/core/inference/contexts/attention_context/triton/tensor_ops.py +megatron/core/inference/engines/__init__.py +megatron/core/inference/engines/abstract_engine.py +megatron/core/inference/engines/async_zmq_communicator.py +megatron/core/inference/engines/dynamic_engine.py +megatron/core/inference/engines/mcore_engine.py +megatron/core/inference/engines/static_engine.py +megatron/core/inference/model_inference_wrappers/__init__.py +megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/gpt/__init__.py +megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/multimodal/vlm_inference_wrapper.py +megatron/core/inference/model_inference_wrappers/t5/__init__.py +megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py +megatron/core/inference/moe/__init__.py +megatron/core/inference/moe/activations.py +megatron/core/inference/moe/fused_moe.py +megatron/core/inference/moe/pad.py +megatron/core/inference/moe/permute.py +megatron/core/inference/quantization/__init__.py +megatron/core/inference/quantization/mxfp8_quantize.py +megatron/core/inference/quantization/mxfp8_tensor.py +megatron/core/inference/quantization/utils.py +megatron/core/inference/text_generation_controllers/__init__.py +megatron/core/inference/text_generation_controllers/encoder_decoder_text_generation_controller.py +megatron/core/inference/text_generation_controllers/text_generation_controller.py +megatron/core/inference/text_generation_controllers/vlm_text_generation_controller.py +megatron/core/inference/text_generation_server/__init__.py +megatron/core/inference/text_generation_server/run_mcore_engine.py +megatron/core/inference/text_generation_server/text_generation_server.py +megatron/core/inference/text_generation_server/tokenization.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/__init__.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/text_generation_server.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/tokenization.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/__init__.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/chat_completions.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/common.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/completions.py +megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/health.py +megatron/core/inference/text_generation_server/endpoints/common.py +megatron/core/inference/text_generation_server/endpoints/completions.py +megatron/core/models/__init__.py +megatron/core/models/backends.py +megatron/core/models/T5/__init__.py +megatron/core/models/T5/t5_model.py +megatron/core/models/T5/t5_spec.py +megatron/core/models/bert/__init__.py +megatron/core/models/bert/bert_layer_specs.py +megatron/core/models/bert/bert_lm_head.py +megatron/core/models/bert/bert_model.py +megatron/core/models/bert/pooler.py +megatron/core/models/common/__init__.py +megatron/core/models/common/model_chunk_schedule_plan.py +megatron/core/models/common/embeddings/__init__.py +megatron/core/models/common/embeddings/language_model_embedding.py +megatron/core/models/common/embeddings/relative_pos_embedding.py +megatron/core/models/common/embeddings/rope_utils.py +megatron/core/models/common/embeddings/rotary_pos_embedding.py +megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py +megatron/core/models/common/language_module/__init__.py +megatron/core/models/common/language_module/language_module.py +megatron/core/models/common/vision_module/__init__.py +megatron/core/models/common/vision_module/vision_module.py +megatron/core/models/gpt/__init__.py +megatron/core/models/gpt/experimental_attention_variant_module_specs.py +megatron/core/models/gpt/fine_grained_callables.py +megatron/core/models/gpt/gpt_layer_specs.py +megatron/core/models/gpt/gpt_model.py +megatron/core/models/gpt/moe_module_specs.py +megatron/core/models/gpt/heterogeneous/heterogeneous_layer_specs.py +megatron/core/models/huggingface/__init__.py +megatron/core/models/huggingface/clip_model.py +megatron/core/models/huggingface/module.py +megatron/core/models/huggingface/qwen_model.py +megatron/core/models/mamba/__init__.py +megatron/core/models/mamba/mamba_layer_specs.py +megatron/core/models/mamba/mamba_model.py +megatron/core/models/mimo/__init__.py +megatron/core/models/mimo/optimizer.py +megatron/core/models/mimo/config/__init__.py +megatron/core/models/mimo/config/base_configs.py +megatron/core/models/mimo/config/role.py +megatron/core/models/mimo/model/__init__.py +megatron/core/models/mimo/model/base.py +megatron/core/models/mimo/partition/utils.py +megatron/core/models/mimo/submodules/audio.py +megatron/core/models/mimo/submodules/base.py +megatron/core/models/mimo/submodules/vision.py +megatron/core/models/multimodal/__init__.py +megatron/core/models/multimodal/context_parallel.py +megatron/core/models/multimodal/llava_model.py +megatron/core/models/multimodal/llava_spec.py +megatron/core/models/vision/__init__.py +megatron/core/models/vision/clip_vit_model.py +megatron/core/models/vision/multimodal_projector.py +megatron/core/models/vision/radio.py +megatron/core/models/vision/vit_layer_specs.py +megatron/core/optimizer/__init__.py +megatron/core/optimizer/clip_grads.py +megatron/core/optimizer/distrib_optimizer.py +megatron/core/optimizer/emerging_optimizers.py +megatron/core/optimizer/grad_scaler.py +megatron/core/optimizer/layer_wise_optimizer.py +megatron/core/optimizer/muon.py +megatron/core/optimizer/optimizer.py +megatron/core/optimizer/optimizer_config.py +megatron/core/optimizer/optimizer_cuda_graph.py +megatron/core/optimizer/qk_clip.py +megatron/core/optimizer/cpu_offloading/__init__.py +megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py +megatron/core/pipeline_parallel/__init__.py +megatron/core/pipeline_parallel/bridge_communicator.py +megatron/core/pipeline_parallel/combined_1f1b.py +megatron/core/pipeline_parallel/fine_grained_activation_offload.py +megatron/core/pipeline_parallel/hybrid_cp_schedule.py +megatron/core/pipeline_parallel/multimodule_communicator.py +megatron/core/pipeline_parallel/p2p_communication.py +megatron/core/pipeline_parallel/schedules.py +megatron/core/pipeline_parallel/utils.py +megatron/core/post_training/__init__.py +megatron/core/post_training/modelopt/__init__.py +megatron/core/post_training/modelopt/layers.py +megatron/core/post_training/modelopt/gpt/__init__.py +megatron/core/post_training/modelopt/gpt/model_specs.py +megatron/core/post_training/modelopt/gpt/state_dict_hooks.py +megatron/core/post_training/modelopt/mamba/__init__.py +megatron/core/post_training/modelopt/mamba/model_specs.py +megatron/core/quantization/__init__.py +megatron/core/quantization/quant_config.py +megatron/core/quantization/utils.py +megatron/core/resharding/__init__.py +megatron/core/resharding/execution.py +megatron/core/resharding/planner.py +megatron/core/resharding/refit.py +megatron/core/resharding/transforms.py +megatron/core/resharding/utils.py +megatron/core/resharding/copy_services/__init__.py +megatron/core/resharding/copy_services/base.py +megatron/core/resharding/copy_services/gloo_copy_service.py +megatron/core/resharding/copy_services/nccl_copy_service.py +megatron/core/resharding/copy_services/nvshmem_copy_service.py +megatron/core/resharding/nvshmem_copy_service/__init__.py +megatron/core/resharding/nvshmem_copy_service/compat.py +megatron/core/resharding/nvshmem_copy_service/logger.py +megatron/core/resharding/nvshmem_copy_service/nvshmem_types.py +megatron/core/resharding/nvshmem_copy_service/service.py +megatron/core/resharding/nvshmem_copy_service/validation.py +megatron/core/resharding/nvshmem_copy_service/core/__init__.py +megatron/core/resharding/nvshmem_copy_service/core/gpu_resource_manager.py +megatron/core/resharding/nvshmem_copy_service/core/kernel_launcher.py +megatron/core/resharding/nvshmem_copy_service/core/pipeline_executor.py +megatron/core/resharding/nvshmem_copy_service/memory/__init__.py +megatron/core/resharding/nvshmem_copy_service/memory/double_buffer_manager.py +megatron/core/resharding/nvshmem_copy_service/memory/tensor_pointer_utils.py +megatron/core/resharding/nvshmem_copy_service/planning/__init__.py +megatron/core/resharding/nvshmem_copy_service/planning/communication_scheduler.py +megatron/core/resharding/nvshmem_copy_service/planning/gpu_execution_planner.py +megatron/core/resharding/nvshmem_copy_service/planning/task_segmenter.py +megatron/core/resharding/nvshmem_copy_service/planning/workload_packer.py +megatron/core/ssm/__init__.py +megatron/core/ssm/gated_delta_net.py +megatron/core/ssm/mamba_block.py +megatron/core/ssm/mamba_context_parallel.py +megatron/core/ssm/mamba_hybrid_layer_allocation.py +megatron/core/ssm/mamba_layer.py +megatron/core/ssm/mamba_mixer.py +megatron/core/ssm/mlp_layer.py +megatron/core/ssm/triton_cache_manager.py +megatron/core/ssm/ops/__init__.py +megatron/core/ssm/ops/causal_conv1d_triton.py +megatron/core/ssm/ops/causal_conv1d_varlen.py +megatron/core/ssm/ops/determinism.py +megatron/core/ssm/ops/mamba_ssm.py +megatron/core/ssm/ops/ssd_bmm.py +megatron/core/ssm/ops/ssd_chunk_scan.py +megatron/core/ssm/ops/ssd_chunk_state.py +megatron/core/ssm/ops/ssd_combined.py +megatron/core/ssm/ops/ssd_state_passing.py +megatron/core/tensor_parallel/__init__.py +megatron/core/tensor_parallel/cross_entropy.py +megatron/core/tensor_parallel/data.py +megatron/core/tensor_parallel/inference_layers.py +megatron/core/tensor_parallel/layers.py +megatron/core/tensor_parallel/mappings.py +megatron/core/tensor_parallel/random.py +megatron/core/tensor_parallel/utils.py +megatron/core/tokenizers/__init__.py +megatron/core/tokenizers/base_tokenizer.py +megatron/core/tokenizers/megatron_tokenizer.py +megatron/core/tokenizers/text/__init__.py +megatron/core/tokenizers/text/text_tokenizer.py +megatron/core/tokenizers/text/libraries/__init__.py +megatron/core/tokenizers/text/libraries/abstract_tokenizer.py +megatron/core/tokenizers/text/libraries/bytelevel_tokenizer.py +megatron/core/tokenizers/text/libraries/chat_template.py +megatron/core/tokenizers/text/libraries/huggingface_tokenizer.py +megatron/core/tokenizers/text/libraries/megatron_hf_tokenizer.py +megatron/core/tokenizers/text/libraries/null_tokenizer.py +megatron/core/tokenizers/text/libraries/sentencepiece_tokenizer.py +megatron/core/tokenizers/text/libraries/sft_tokenizer.py +megatron/core/tokenizers/text/libraries/tiktoken_tokenizer.py +megatron/core/tokenizers/text/models/__init__.py +megatron/core/tokenizers/text/models/bert_tokenizer.py +megatron/core/tokenizers/text/models/default_tokenizer.py +megatron/core/tokenizers/text/models/gpt_tokenizer.py +megatron/core/tokenizers/text/models/mamba_tokenizer.py +megatron/core/tokenizers/text/models/t5_tokenizer.py +megatron/core/tokenizers/text/parsers/__init__.py +megatron/core/tokenizers/text/parsers/base_parser.py +megatron/core/tokenizers/text/parsers/deepseek_r1_reasoning_parser.py +megatron/core/tokenizers/text/parsers/qwen3_coder_tool_parser.py +megatron/core/tokenizers/utils/build_tokenizer.py +megatron/core/tokenizers/vision/__init__.py +megatron/core/tokenizers/vision/vision_tokenizer.py +megatron/core/tokenizers/vision/libraries/__init__.py +megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +megatron/core/tokenizers/vision/libraries/null_multimodal_tokenizer.py +megatron/core/tokenizers/vision/models/__init__.py +megatron/core/tokenizers/vision/models/default_tokenizer.py +megatron/core/transformer/__init__.py +megatron/core/transformer/attention.py +megatron/core/transformer/cuda_graphs.py +megatron/core/transformer/dot_product_attention.py +megatron/core/transformer/enums.py +megatron/core/transformer/fsdp_dtensor_checkpoint.py +megatron/core/transformer/identity_op.py +megatron/core/transformer/mlp.py +megatron/core/transformer/module.py +megatron/core/transformer/multi_latent_attention.py +megatron/core/transformer/multi_token_prediction.py +megatron/core/transformer/pipeline_parallel_layer_layout.py +megatron/core/transformer/spec_utils.py +megatron/core/transformer/torch_layer_norm.py +megatron/core/transformer/torch_norm.py +megatron/core/transformer/transformer_block.py +megatron/core/transformer/transformer_config.py +megatron/core/transformer/transformer_layer.py +megatron/core/transformer/utils.py +megatron/core/transformer/custom_layers/__init__.py +megatron/core/transformer/custom_layers/batch_invariant_kernels.py +megatron/core/transformer/experimental_attention_variant/absorbed_mla.py +megatron/core/transformer/experimental_attention_variant/dsa.py +megatron/core/transformer/heterogeneous/heterogeneous_config.py +megatron/core/transformer/heterogeneous/linear_replacements.py +megatron/core/transformer/moe/__init__.py +megatron/core/transformer/moe/experts.py +megatron/core/transformer/moe/fused_a2a.py +megatron/core/transformer/moe/moe_layer.py +megatron/core/transformer/moe/moe_utils.py +megatron/core/transformer/moe/router.py +megatron/core/transformer/moe/router_replay.py +megatron/core/transformer/moe/shared_experts.py +megatron/core/transformer/moe/token_dispatcher.py +megatron/core/transformer/moe/token_dispatcher_inference.py +megatron/core/transformer/moe/upcycling_utils.py +megatron/training/__init__.py +megatron/training/argument_utils.py +megatron/training/arguments.py +megatron/training/async_utils.py +megatron/training/checkpointing.py +megatron/training/dgrad_logging.py +megatron/training/dist_signal_handler.py +megatron/training/ft_integration.py +megatron/training/global_vars.py +megatron/training/initialize.py +megatron/training/inprocess_restart.py +megatron/training/log_handler.py +megatron/training/one_logger_utils.py +megatron/training/theoretical_memory_usage.py +megatron/training/training.py +megatron/training/utils.py +megatron/training/wandb_utils.py +megatron/training/yaml_arguments.py +megatron/training/config/__init__.py +megatron/training/config/common_config.py +megatron/training/config/resilience_config.py +megatron/training/config/training_config.py +megatron/training/datasets/__init__.py +megatron/training/datasets/data_samplers.py +megatron/training/datasets/fim_dataset.py +megatron/training/datasets/sft_dataset.py +megatron_core.egg-info/PKG-INFO +megatron_core.egg-info/SOURCES.txt +megatron_core.egg-info/dependency_links.txt +megatron_core.egg-info/requires.txt +megatron_core.egg-info/top_level.txt \ No newline at end of file diff --git a/megatron_core.egg-info.bak/dependency_links.txt b/megatron_core.egg-info.bak/dependency_links.txt new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/megatron_core.egg-info.bak/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/megatron_core.egg-info.bak/requires.txt b/megatron_core.egg-info.bak/requires.txt new file mode 100644 index 00000000000..50312bd5967 --- /dev/null +++ b/megatron_core.egg-info.bak/requires.txt @@ -0,0 +1,65 @@ +torch>=2.6.0 +numpy +packaging>=24.2 + +[dev] +transformer-engine[core_cu13,pytorch] +nvidia-resiliency-ext +tqdm +einops~=0.8 +tensorstore!=0.1.46,!=0.1.72,~=0.1 +nvtx~=0.2 +multi-storage-client~=0.27 +opentelemetry-api~=1.33.1 +mamba-ssm~=2.2 +causal-conv1d~=1.5 +flash-linear-attention~=0.4.0 +megatron-energon[av_decode]~=6.0 +av +flashinfer-python~=0.5.0 +wget +onnxscript +fastapi~=0.50 +datasets +emerging_optimizers +hypercorn +quart +openai[aiohttp] +orjson + +[dev:sys_platform != "darwin"] +nvidia-modelopt[torch] + +[lts] +tqdm +einops~=0.8 +tensorstore!=0.1.46,!=0.1.72,~=0.1 +nvtx~=0.2 +multi-storage-client~=0.27 +opentelemetry-api~=1.33.1 +mamba-ssm~=2.2 +causal-conv1d~=1.5 +megatron-energon[av_decode]~=6.0 +av +flashinfer-python~=0.5.0 +wget +onnxscript +fastapi~=0.50 +datasets +emerging_optimizers + +[mlm] +flask-restful +sentencepiece +tiktoken +wandb +transformers +accelerate + +[training] +flask-restful +sentencepiece +tiktoken +wandb +transformers +accelerate diff --git a/megatron_core.egg-info.bak/top_level.txt b/megatron_core.egg-info.bak/top_level.txt new file mode 100644 index 00000000000..3bfbb11f4a7 --- /dev/null +++ b/megatron_core.egg-info.bak/top_level.txt @@ -0,0 +1 @@ +megatron diff --git a/uv.lock b/uv.lock index 59527b68746..a399d03fa4a 100644 --- a/uv.lock +++ b/uv.lock @@ -1047,79 +1047,30 @@ wheels = [ [[package]] name = "datasets" -version = "2.2.1" +version = "4.8.5" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'win32'", -] -dependencies = [ - { name = "aiohttp", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "dill", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "huggingface-hub", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "multiprocess", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", version = "26.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pandas", version = "3.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pyarrow", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "requests", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "responses", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "tqdm", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "xxhash", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/31/64/1e6fb2a0eb6b0d55117233cf33279ba6d680c0f031ebae81281a47c92760/datasets-2.2.1.tar.gz", hash = "sha256:d362717c4394589b516c8f397ff20a6fe720454aed877ab61d06f3bc05df9544", size = 302132, upload-time = "2022-05-11T17:02:29.543Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/2d/41e8aec8d4bad6f07adfcbc89cf743e0d31c876371d453b2936bcfa7fe34/datasets-2.2.1-py3-none-any.whl", hash = "sha256:1938f3e99599422de50b9b54fe802aca854ed130382dab0b3820c821f7ae6d5e", size = 342193, upload-time = "2022-05-11T17:02:27.047Z" }, -] - -[[package]] -name = "datasets" -version = "4.8.4" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", -] dependencies = [ - { name = "dill", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "filelock", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "httpx", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "huggingface-hub", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "multiprocess", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", version = "26.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pandas", version = "3.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "pyarrow", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "pyyaml", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "requests", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "tqdm", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "xxhash", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, + { name = "dill" }, + { name = "filelock" }, + { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "extra == 'extra-13-megatron-core-dev' or extra == 'extra-13-megatron-core-lts'" }, + { name = "httpx" }, + { name = "huggingface-hub" }, + { name = "multiprocess" }, + { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, + { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "pandas", version = "3.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, + { name = "pyarrow" }, + { name = "pyyaml" }, + { name = "requests" }, + { name = "tqdm" }, + { name = "xxhash" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/22/22/73e46ac7a8c25e7ef0b3bd6f10da3465021d90219a32eb0b4d2afea4c56e/datasets-4.8.4.tar.gz", hash = "sha256:a1429ed853275ce7943a01c6d2e25475b4501eb758934362106a280470df3a52", size = 604382, upload-time = "2026-03-23T14:21:17.987Z" } +sdist = { url = "https://files.pythonhosted.org/packages/66/34/14cd8e76f907f7d4dca2334cfeec9f81d30fd15c25a015f99aaea694eaed/datasets-4.8.5.tar.gz", hash = "sha256:0f0c1c3d56ffff2c93b2f4c63c95bac94f3d7e8621aea2a2a576275233bba772", size = 605649, upload-time = "2026-04-27T15:43:57.384Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b0/e5/247d094108e42ac26363ab8dc57f168840cf7c05774b40ffeb0d78868fcc/datasets-4.8.4-py3-none-any.whl", hash = "sha256:cdc8bee4698e549d78bf1fed6aea2eebc760b22b084f07e6fc020c6577a6ce6d", size = 526991, upload-time = "2026-03-23T14:21:15.89Z" }, + { url = "https://files.pythonhosted.org/packages/65/99/00f3196036501b53032c4b1ab8337a0b978dee832ed276dae3815df4e8b5/datasets-4.8.5-py3-none-any.whl", hash = "sha256:5079900781719c0e063a8efdd2cd95a31ad0c63209178669cd23cf1b926149ff", size = 528973, upload-time = "2026-04-27T15:43:53.702Z" }, ] [[package]] @@ -1521,6 +1472,8 @@ name = "fsspec" version = "2026.2.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'win32'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'win32'", "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", @@ -1545,7 +1498,7 @@ wheels = [ [package.optional-dependencies] http = [ - { name = "aiohttp", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, + { name = "aiohttp" }, ] [[package]] @@ -1561,11 +1514,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d5/1f/5f4a3cd9e4440e9d9bc78ad0a91a1c8d46b4d429d5239ebe6793c9fe5c41/fsspec-2026.3.0-py3-none-any.whl", hash = "sha256:d2ceafaad1b3457968ed14efa28798162f1638dbb5d2a6868a2db002a5ee39a4", size = 202595, upload-time = "2026-03-27T19:11:13.595Z" }, ] -[package.optional-dependencies] -http = [ - { name = "aiohttp", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, -] - [[package]] name = "gitdb" version = "4.0.12" @@ -1908,23 +1856,24 @@ wheels = [ [[package]] name = "huggingface-hub" -version = "0.36.2" +version = "1.13.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock" }, - { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "hf-xet", marker = "platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, + { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32' or extra == 'extra-13-megatron-core-dev' or extra == 'extra-13-megatron-core-lts'" }, + { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, + { name = "httpx" }, { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "packaging", version = "26.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pyyaml" }, - { name = "requests" }, { name = "tqdm" }, + { name = "typer" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/b7/8cb61d2eece5fb05a83271da168186721c450eb74e3c31f7ef3169fa475b/huggingface_hub-0.36.2.tar.gz", hash = "sha256:1934304d2fb224f8afa3b87007d58501acfda9215b334eed53072dd5e815ff7a", size = 649782, upload-time = "2026-02-06T09:24:13.098Z" } +sdist = { url = "https://files.pythonhosted.org/packages/89/ff/ec7ed2eb43bd7ce8bb2233d109cc235c3e807ffe5e469dc09db261fac05e/huggingface_hub-1.13.0.tar.gz", hash = "sha256:f6df2dac5abe82ce2fe05873d10d5ff47bc677d616a2f521f4ee26db9415d9d0", size = 781788, upload-time = "2026-04-30T11:57:33.858Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/af/48ac8483240de756d2438c380746e7130d1c6f75802ef22f3c6d49982787/huggingface_hub-0.36.2-py3-none-any.whl", hash = "sha256:48f0c8eac16145dfce371e9d2d7772854a4f591bcb56c9cf548accf531d54270", size = 566395, upload-time = "2026-02-06T09:24:11.133Z" }, + { url = "https://files.pythonhosted.org/packages/93/db/4b1cdae9460ae1f3ca020cd767f013430ce23eb1d9c890ae3a0609b38d26/huggingface_hub-1.13.0-py3-none-any.whl", hash = "sha256:e942cb50d6a08dd5306688b1ac05bda157fd2fcc88b63dae405f7bd0d3234005", size = 660643, upload-time = "2026-04-30T11:57:31.802Z" }, ] [[package]] @@ -2587,8 +2536,7 @@ dependencies = [ [package.optional-dependencies] dev = [ { name = "av" }, - { name = "datasets", version = "2.2.1", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "datasets", version = "4.8.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "datasets" }, { name = "einops" }, { name = "emerging-optimizers" }, { name = "fastapi" }, @@ -2612,8 +2560,7 @@ dev = [ ] lts = [ { name = "av" }, - { name = "datasets", version = "2.2.1", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "datasets", version = "4.8.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "datasets" }, { name = "einops" }, { name = "emerging-optimizers" }, { name = "fastapi" }, @@ -2822,8 +2769,7 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "pillow" }, { name = "pyyaml" }, - { name = "s3fs", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "s3fs", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "s3fs" }, { name = "torch", marker = "sys_platform == 'never'" }, { name = "tqdm" }, { name = "webdataset" }, @@ -3278,16 +3224,16 @@ resolution-markers = [ "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] sdist = { url = "https://files.pythonhosted.org/packages/a9/75/10dd1f8116a8b796cb2c737b674e02d02e80454bda953fa7e65d8c12b016/numpy-2.0.2.tar.gz", hash = "sha256:883c987dee1880e2a864ab0dc9892292582510604156762362d9326444636e78", size = 18902015, upload-time = "2024-08-26T20:19:40.945Z" } @@ -4313,16 +4259,16 @@ resolution-markers = [ "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } @@ -4371,16 +4317,16 @@ resolution-markers = [ "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] dependencies = [ @@ -5578,19 +5524,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", size = 54481, upload-time = "2023-05-01T04:11:28.427Z" }, ] -[[package]] -name = "responses" -version = "0.18.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "requests", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "urllib3", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/03/a5/186653e51cb20fe3ac793403334d4d077fbb7bb18a9c5c2fce8304d5a2e2/responses-0.18.0.tar.gz", hash = "sha256:380cad4c1c1dc942e5e8a8eaae0b4d4edf708f4f010db8b7bcfafad1fcd254ff", size = 45885, upload-time = "2022-02-02T19:59:52.834Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/79/f3/2b3a6dc5986303b3dd1bbbcf482022acb2583c428cd23f0b6d37b1a1a519/responses-0.18.0-py3-none-any.whl", hash = "sha256:15c63ad16de13ee8e7182d99c9334f64fd81f1ee79f90748d527c28f7ca9dd51", size = 38735, upload-time = "2022-02-02T19:59:52.833Z" }, -] - [[package]] name = "rich" version = "15.0.0" @@ -5723,52 +5656,16 @@ wheels = [ name = "s3fs" version = "2026.2.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", - "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", - "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", -] dependencies = [ - { name = "aiobotocore", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "aiohttp", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, - { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, + { name = "aiobotocore" }, + { name = "aiohttp" }, + { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/fa/be/392c8c5e0da9bfa139e41084690dd49a5e3e931099f78f52d3f6070105c6/s3fs-2026.2.0.tar.gz", hash = "sha256:91cb2a9f76e35643b76eeac3f47a6165172bb3def671f76b9111c8dd5779a2ac", size = 84152, upload-time = "2026-02-05T21:57:57.968Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/57/e1/64c264db50b68de8a438b60ceeb921b2f22da3ebb7ad6255150225d0beac/s3fs-2026.2.0-py3-none-any.whl", hash = "sha256:65198835b86b1d5771112b0085d1da52a6ede36508b1aaa6cae2aedc765dfe10", size = 31328, upload-time = "2026-02-05T21:57:56.532Z" }, ] -[[package]] -name = "s3fs" -version = "2026.3.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'win32'", - "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'win32'", -] -dependencies = [ - { name = "aiobotocore", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "aiohttp", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, - { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/0b/93/093972862fb9c2fdc24ecf8d6d2212853df1945eddf26ba2625e8eaeee66/s3fs-2026.3.0.tar.gz", hash = "sha256:ce8b30a9dc5e01c5127c96cb7377290243a689a251ef9257336ac29d72d7b0d8", size = 85986, upload-time = "2026-03-27T19:28:20.963Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6a/52/5ccdc01f7a8a61357d15a66b5d8a6580aa8529cb33f32e6cbb71c52622c5/s3fs-2026.3.0-py3-none-any.whl", hash = "sha256:2fa40a64c03003cfa5ae0e352788d97aa78ae8f9e25ea98b28ce9d21ba10c1b8", size = 32399, upload-time = "2026-03-27T19:28:19.702Z" }, -] - [[package]] name = "safetensors" version = "0.7.0" @@ -6611,8 +6508,8 @@ dependencies = [ { name = "docker" }, { name = "docstring-parser" }, { name = "filelock" }, - { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32' or extra == 'extra-13-megatron-core-dev' or extra == 'extra-13-megatron-core-lts'" }, + { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "importlib-metadata" }, { name = "pyre-extensions" }, { name = "pyyaml" }, @@ -6656,10 +6553,9 @@ dependencies = [ [[package]] name = "transformers" -version = "4.57.6" +version = "5.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "filelock" }, { name = "huggingface-hub" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, @@ -6667,14 +6563,14 @@ dependencies = [ { name = "packaging", version = "26.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pyyaml" }, { name = "regex" }, - { name = "requests" }, { name = "safetensors" }, { name = "tokenizers" }, { name = "tqdm" }, + { name = "typer" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c4/35/67252acc1b929dc88b6602e8c4a982e64f31e733b804c14bc24b47da35e6/transformers-4.57.6.tar.gz", hash = "sha256:55e44126ece9dc0a291521b7e5492b572e6ef2766338a610b9ab5afbb70689d3", size = 10134912, upload-time = "2026-01-16T10:38:39.284Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4d/fe/7e84d20ac7d4d5d14bac2eab5976088d86342959fc2c0da54b4c2fc99856/transformers-5.7.0.tar.gz", hash = "sha256:a9d35cf39804e3456c1f9bc1a79ad5ffa878640a61f51f66f71c97f4b4e2ce10", size = 8401287, upload-time = "2026-04-28T18:30:09.75Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/03/b8/e484ef633af3887baeeb4b6ad12743363af7cce68ae51e938e00aaa0529d/transformers-4.57.6-py3-none-any.whl", hash = "sha256:4c9e9de11333ddfe5114bc872c9f370509198acf0b87a832a0ab9458e2bd0550", size = 11993498, upload-time = "2026-01-16T10:38:31.289Z" }, + { url = "https://files.pythonhosted.org/packages/60/60/86a9fe3037bec221094e2acb680219ad88b77006edba42fc0407a577ca93/transformers-5.7.0-py3-none-any.whl", hash = "sha256:869660cd8fc92badc041f5551bf755a42f4b9558c93341bf3fa3eeed7065079c", size = 10474236, upload-time = "2026-04-28T18:30:05.655Z" }, ] [[package]] From 3f28c0c8aabbb692bd5e2af68df2fe821a0f0fea Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 07:37:43 -0700 Subject: [PATCH 08/12] revert changes Signed-off-by: dimapihtar --- examples/multimodal/Dockerfile | 2 +- megatron_core.egg-info.bak/PKG-INFO | 255 ---------- megatron_core.egg-info.bak/SOURCES.txt | 444 ------------------ .../dependency_links.txt | 1 - megatron_core.egg-info.bak/requires.txt | 65 --- megatron_core.egg-info.bak/top_level.txt | 1 - 6 files changed, 1 insertion(+), 767 deletions(-) delete mode 100644 megatron_core.egg-info.bak/PKG-INFO delete mode 100644 megatron_core.egg-info.bak/SOURCES.txt delete mode 100644 megatron_core.egg-info.bak/dependency_links.txt delete mode 100644 megatron_core.egg-info.bak/requires.txt delete mode 100644 megatron_core.egg-info.bak/top_level.txt diff --git a/examples/multimodal/Dockerfile b/examples/multimodal/Dockerfile index 4ed66900179..d7c4fd41af5 100644 --- a/examples/multimodal/Dockerfile +++ b/examples/multimodal/Dockerfile @@ -16,7 +16,7 @@ RUN uv pip install --system --no-cache --break-system-packages \ braceexpand \ webdataset \ packaging \ - transformers \ + "transformers<5.0.0" \ datasets \ accelerate \ timm \ diff --git a/megatron_core.egg-info.bak/PKG-INFO b/megatron_core.egg-info.bak/PKG-INFO deleted file mode 100644 index 05bbfded449..00000000000 --- a/megatron_core.egg-info.bak/PKG-INFO +++ /dev/null @@ -1,255 +0,0 @@ -Metadata-Version: 2.4 -Name: megatron-core -Version: 0.18.0rc0 -Summary: Megatron Core - a library for efficient and scalable training of transformer based models -Author-email: NVIDIA -Maintainer-email: NVIDIA -License: Apache 2.0 -Project-URL: Download, https://github.com/NVIDIA/Megatron-LM/releases -Project-URL: Homepage, https://github.com/NVIDIA/Megatron-LM -Keywords: NLP,NLU,deep,gpu,language,learning,machine,nvidia,pytorch,torch,transformer -Classifier: Development Status :: 5 - Production/Stable -Classifier: Environment :: Console -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Information Technology -Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: BSD License -Classifier: Natural Language :: English -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence -Classifier: Topic :: Scientific/Engineering :: Image Recognition -Classifier: Topic :: Scientific/Engineering :: Mathematics -Classifier: Topic :: Scientific/Engineering -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: Software Development :: Libraries -Classifier: Topic :: Utilities -Requires-Python: >=3.12 -Description-Content-Type: text/markdown -License-File: LICENSE -Requires-Dist: torch>=2.6.0 -Requires-Dist: numpy -Requires-Dist: packaging>=24.2 -Provides-Extra: training -Requires-Dist: flask-restful; extra == "training" -Requires-Dist: sentencepiece; extra == "training" -Requires-Dist: tiktoken; extra == "training" -Requires-Dist: wandb; extra == "training" -Requires-Dist: transformers; extra == "training" -Requires-Dist: accelerate; extra == "training" -Provides-Extra: mlm -Requires-Dist: flask-restful; extra == "mlm" -Requires-Dist: sentencepiece; extra == "mlm" -Requires-Dist: tiktoken; extra == "mlm" -Requires-Dist: wandb; extra == "mlm" -Requires-Dist: transformers; extra == "mlm" -Requires-Dist: accelerate; extra == "mlm" -Provides-Extra: dev -Requires-Dist: nvidia-modelopt[torch]; sys_platform != "darwin" and extra == "dev" -Requires-Dist: transformer-engine[core_cu13,pytorch]; extra == "dev" -Requires-Dist: nvidia-resiliency-ext; extra == "dev" -Requires-Dist: tqdm; extra == "dev" -Requires-Dist: einops~=0.8; extra == "dev" -Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "dev" -Requires-Dist: nvtx~=0.2; extra == "dev" -Requires-Dist: multi-storage-client~=0.27; extra == "dev" -Requires-Dist: opentelemetry-api~=1.33.1; extra == "dev" -Requires-Dist: mamba-ssm~=2.2; extra == "dev" -Requires-Dist: causal-conv1d~=1.5; extra == "dev" -Requires-Dist: flash-linear-attention~=0.4.0; extra == "dev" -Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "dev" -Requires-Dist: av; extra == "dev" -Requires-Dist: flashinfer-python~=0.5.0; extra == "dev" -Requires-Dist: wget; extra == "dev" -Requires-Dist: onnxscript; extra == "dev" -Requires-Dist: fastapi~=0.50; extra == "dev" -Requires-Dist: datasets; extra == "dev" -Requires-Dist: emerging_optimizers; extra == "dev" -Requires-Dist: hypercorn; extra == "dev" -Requires-Dist: quart; extra == "dev" -Requires-Dist: openai[aiohttp]; extra == "dev" -Requires-Dist: orjson; extra == "dev" -Provides-Extra: lts -Requires-Dist: tqdm; extra == "lts" -Requires-Dist: einops~=0.8; extra == "lts" -Requires-Dist: tensorstore!=0.1.46,!=0.1.72,~=0.1; extra == "lts" -Requires-Dist: nvtx~=0.2; extra == "lts" -Requires-Dist: multi-storage-client~=0.27; extra == "lts" -Requires-Dist: opentelemetry-api~=1.33.1; extra == "lts" -Requires-Dist: mamba-ssm~=2.2; extra == "lts" -Requires-Dist: causal-conv1d~=1.5; extra == "lts" -Requires-Dist: megatron-energon[av_decode]~=6.0; extra == "lts" -Requires-Dist: av; extra == "lts" -Requires-Dist: flashinfer-python~=0.5.0; extra == "lts" -Requires-Dist: wget; extra == "lts" -Requires-Dist: onnxscript; extra == "lts" -Requires-Dist: fastapi~=0.50; extra == "lts" -Requires-Dist: datasets; extra == "lts" -Requires-Dist: emerging_optimizers; extra == "lts" -Dynamic: license-file - -
- -Megatron-LM and Megatron Core -============================= - -

GPU-optimized library for training transformer models at scale

- -[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html) -[![version](https://img.shields.io/badge/release-0.15.0-green)](./CHANGELOG.md) -[![license](https://img.shields.io/badge/license-Apache-blue)](./LICENSE) - -
- -## About - -This repository contains two components: **Megatron-LM** and **Megatron Core**. - -**Megatron-LM** is a reference example that includes Megatron Core plus pre-configured training scripts. Best for research teams, learning distributed training, and quick experimentation. - -**Megatron Core** is a composable library with GPU-optimized building blocks for custom training frameworks. It provides transformer building blocks, advanced parallelism strategies (TP, PP, DP, EP, CP), mixed precision support (FP16, BF16, FP8, FP4), and model architectures. Best for framework developers and ML engineers building custom training pipelines. - -**[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** provides bidirectional Hugging Face ↔ Megatron checkpoint conversion with production-ready recipes. - -## Getting Started - -**Install from PyPI:** - -```bash -uv pip install megatron-core -``` - -**Or clone and install from source:** - -```bash -git clone https://github.com/NVIDIA/Megatron-LM.git -cd Megatron-LM -uv pip install -e . -``` - -> **Note:** Building from source can use a lot of memory. If the build runs out of memory, limit parallel compilation jobs by setting `MAX_JOBS` (e.g. `MAX_JOBS=4 uv pip install -e .`). - -For NGC container setup and all installation options, see the **[Installation Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/install.html)**. - -- **[Your First Training Run](https://docs.nvidia.com/megatron-core/developer-guide/latest/get-started/quickstart.html)** - End-to-end training examples with data preparation -- **[Parallelism Strategies](https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/parallelism-guide.html)** - Scale training across GPUs with TP, PP, DP, EP, and CP -- **[Contribution Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - How to contribute to Megatron Core - -# Latest News - -- **[2026/03]** **Deprecating Python 3.10 support:** We're officially dropping Python 3.10 support with the upcoming 0.17.0 release. Downstream applications must raise their lower boundary to 3.12 to stay compatible with MCore. -- **[2026/01]** **[Dynamic Context Parallelism](https://developer.nvidia.com/blog/speeding-up-variable-length-training-with-dynamic-context-parallelism-and-nvidia-megatron-core/)** - Up to 1.48x speedup for variable-length sequence training with adaptive CP sizing. -- **[2025/12]** **Megatron Core development has moved to GitHub!** All development and CI now happens in the open. We welcome community contributions. -- **[2025/10]** **[Megatron Dev Branch](https://github.com/NVIDIA/Megatron-LM/tree/dev)** - early access branch with experimental features. -- **[2025/10]** **[Megatron Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)** - Bidirectional converter for interoperability between Hugging Face and Megatron checkpoints, featuring production-ready recipes for popular models. -- **[2025/08]** **[MoE Q3-Q4 2025 Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - Comprehensive roadmap for MoE features including DeepSeek-V3, Qwen3, advanced parallelism strategies, FP8 optimizations, and Blackwell performance enhancements. -- **[2025/08]** **[GPT-OSS Model](https://github.com/NVIDIA/Megatron-LM/issues/1739)** - Advanced features including YaRN RoPE scaling, attention sinks, and custom activation functions are being integrated into Megatron Core. -- **[2025/06]** **[Megatron MoE Model Zoo](https://github.com/yanring/Megatron-MoE-ModelZoo)** - Best practices and optimized configurations for training DeepSeek-V3, Mixtral, and Qwen3 MoE models with performance benchmarking and checkpoint conversion tools. -- **[2025/05]** Megatron Core v0.11.0 brings new capabilities for multi-data center LLM training ([blog](https://developer.nvidia.com/blog/turbocharge-llm-training-across-long-haul-data-center-networks-with-nvidia-nemo-framework/)). - -
-Previous News - -- **[2024/07]** Megatron Core v0.7 improves scalability and training resiliency and adds support for multimodal training ([blog](https://developer.nvidia.com/blog/train-generative-ai-models-more-efficiently-with-new-nvidia-Megatron-Core-functionalities/)). -- **[2024/06]** Megatron Core added supports for Mamba-based models. Check out our paper [An Empirical Study of Mamba-based Language Models](https://arxiv.org/pdf/2406.07887) and [code example](https://github.com/NVIDIA/Megatron-LM/tree/ssm/examples/mamba). -- **[2024/01 Announcement]** NVIDIA has released the core capabilities in **Megatron-LM** into [**Megatron Core**](https://github.com/NVIDIA/Megatron-LM/tree/main/megatron/core) in this repository. Megatron Core expands upon Megatron-LM's GPU-optimized techniques with more cutting-edge innovations on system-level optimizations, featuring composable and modular APIs. - -
- -# Project Structure - -``` -Megatron-LM/ -├── megatron/ -│ ├── core/ # Megatron Core (kernels, parallelism, building blocks) -│ │ ├── models/ # Transformer models -│ │ ├── transformer/ # Transformer building blocks -│ │ ├── tensor_parallel/ # Tensor parallelism -│ │ ├── pipeline_parallel/ # Pipeline parallelism -│ │ ├── distributed/ # Distributed training (FSDP, DDP) -│ │ ├── optimizer/ # Optimizers -│ │ ├── datasets/ # Dataset loaders -│ │ ├── inference/ # Inference engines and server -│ │ └── export/ # Model export (e.g. TensorRT-LLM) -│ ├── training/ # Training scripts -│ ├── legacy/ # Legacy components -│ ├── post_training/ # Post-training (quantization, distillation, pruning, etc.) -│ └── rl/ # Reinforcement learning (RLHF, etc.) -├── examples/ # Ready-to-use training examples -├── tools/ # Utility tools -├── tests/ # Comprehensive test suite -└── docs/ # Documentation -``` - -# Performance Benchmarking - -For our latest performance benchmarking results, please refer to [NVIDIA Megatron Bridge Performance Summary](https://docs.nvidia.com/nemo/megatron-bridge/latest/performance-summary.html). - -Our codebase efficiently trains models from 2B to 462B parameters across thousands of GPUs, achieving up to **47% Model FLOP Utilization (MFU)** on H100 clusters. - -![Model table](images/model_table.png) - -**Benchmark Configuration:** - -- **Vocabulary size**: 131,072 tokens -- **Sequence length**: 4096 tokens -- **Model scaling**: Varied hidden size, attention heads, and layers to achieve target parameter counts -- **Communication optimizations**: Fine-grained overlapping with DP (`--overlap-grad-reduce`, `--overlap-param-gather`), TP (`--tp-comm-overlap`), and PP (enabled by default) - -**Key Results:** - -- **6144 H100 GPUs**: Successfully benchmarked 462B parameter model training -- **Superlinear scaling**: MFU increases from 41% to 47-48% with model size -- **End-to-end measurement**: Throughputs include all operations (data loading, optimizer steps, communication, logging) -- **Production ready**: Full training pipeline with checkpointing and fault tolerance -- *Note: Performance results measured without training to convergence* - -## Weak Scaling Results - -Our weak scaled results show superlinear scaling (MFU increases from 41% for the smallest model considered to 47-48% for the largest models); this is because larger GEMMs have higher arithmetic intensity and are consequently more efficient to execute. - -![Weak scaling](images/weak_scaling.png) - -## Strong Scaling Results - -We also strong scaled the standard GPT-3 model (our version has slightly more than 175 billion parameters due to larger vocabulary size) from 96 H100 GPUs to 4608 GPUs, using the same batch size of 1152 sequences throughout. Communication becomes more exposed at larger scale, leading to a reduction in MFU from 47% to 42%. - -![Strong scaling](images/strong_scaling.png) - -# Roadmaps - -- **[MoE Roadmap](https://github.com/NVIDIA/Megatron-LM/issues/1729)** - DeepSeek-V3, Qwen3, advanced parallelism, FP8 optimizations, and Blackwell enhancements - -# Resources - -## Getting Help - -- 📖 **[Documentation](https://docs.nvidia.com/megatron-core/developer-guide/latest/index.html)** - Official documentation -- 🐛 **[Issues](https://github.com/NVIDIA/Megatron-LM/issues)** - Bug reports and feature requests - -## Contributing - -We ❤️ contributions! Ways to contribute: - -- 🐛 **Report bugs** - Help us improve reliability -- 💡 **Suggest features** - Shape the future of Megatron Core -- 📝 **Improve docs** - Make Megatron Core more accessible -- 🔧 **Submit PRs** - Contribute code improvements - -**→ [Contributing Guide](https://docs.nvidia.com/megatron-core/developer-guide/latest/developer/contribute.html)** - -## Citation - -If you use Megatron in your research or project, we appreciate that you use the following citations: - -```bibtex -@article{megatron-lm, - title={Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism}, - author={Shoeybi, Mohammad and Patwary, Mostofa and Puri, Raul and LeGresley, Patrick and Casper, Jared and Catanzaro, Bryan}, - journal={arXiv preprint arXiv:1909.08053}, - year={2019} -} -``` diff --git a/megatron_core.egg-info.bak/SOURCES.txt b/megatron_core.egg-info.bak/SOURCES.txt deleted file mode 100644 index 4c57cedb34b..00000000000 --- a/megatron_core.egg-info.bak/SOURCES.txt +++ /dev/null @@ -1,444 +0,0 @@ -LICENSE -MANIFEST.in -README.md -pyproject.toml -setup.py -megatron/core/README.md -megatron/core/__init__.py -megatron/core/_rank_utils.py -megatron/core/activations.py -megatron/core/config.py -megatron/core/config_logger.py -megatron/core/energy_monitor.py -megatron/core/enums.py -megatron/core/fp4_utils.py -megatron/core/fp8_utils.py -megatron/core/full_cuda_graph.py -megatron/core/hyper_comm_grid.py -megatron/core/inference_params.py -megatron/core/jit.py -megatron/core/model_parallel_config.py -megatron/core/msc_utils.py -megatron/core/nccl_allocator.py -megatron/core/num_microbatches_calculator.py -megatron/core/optimizer_param_scheduler.py -megatron/core/package_info.py -megatron/core/packed_seq_params.py -megatron/core/parallel_state.py -megatron/core/process_groups_config.py -megatron/core/requirements.txt -megatron/core/rerun_state_machine.py -megatron/core/safe_globals.py -megatron/core/timers.py -megatron/core/typed_torch.py -megatron/core/utils.py -megatron/core/datasets/__init__.py -megatron/core/datasets/bert_dataset.py -megatron/core/datasets/blended_dataset.py -megatron/core/datasets/blended_megatron_dataset_builder.py -megatron/core/datasets/blended_megatron_dataset_config.py -megatron/core/datasets/data_schedule.py -megatron/core/datasets/gpt_dataset.py -megatron/core/datasets/helpers.cpp -megatron/core/datasets/helpers.py -megatron/core/datasets/indexed_dataset.py -megatron/core/datasets/masked_dataset.py -megatron/core/datasets/megatron_dataset.py -megatron/core/datasets/multimodal_dataset.py -megatron/core/datasets/object_storage_utils.py -megatron/core/datasets/t5_dataset.py -megatron/core/datasets/utils.py -megatron/core/datasets/utils_s3.py -megatron/core/dist_checkpointing/__init__.py -megatron/core/dist_checkpointing/core.py -megatron/core/dist_checkpointing/dict_utils.py -megatron/core/dist_checkpointing/exchange_utils.py -megatron/core/dist_checkpointing/mapping.py -megatron/core/dist_checkpointing/optimizer.py -megatron/core/dist_checkpointing/serialization.py -megatron/core/dist_checkpointing/state_dict_utils.py -megatron/core/dist_checkpointing/tensor_aware_state_dict.py -megatron/core/dist_checkpointing/utils.py -megatron/core/dist_checkpointing/validation.py -megatron/core/dist_checkpointing/strategies/__init__.py -megatron/core/dist_checkpointing/strategies/async_utils.py -megatron/core/dist_checkpointing/strategies/base.py -megatron/core/dist_checkpointing/strategies/cached_metadata_filesystem_reader.py -megatron/core/dist_checkpointing/strategies/checkpointable.py -megatron/core/dist_checkpointing/strategies/common.py -megatron/core/dist_checkpointing/strategies/filesystem_async.py -megatron/core/dist_checkpointing/strategies/fully_parallel.py -megatron/core/dist_checkpointing/strategies/state_dict_saver.py -megatron/core/dist_checkpointing/strategies/torch.py -megatron/core/distributed/__init__.py -megatron/core/distributed/data_parallel_base.py -megatron/core/distributed/distributed_data_parallel.py -megatron/core/distributed/distributed_data_parallel_config.py -megatron/core/distributed/finalize_model_grads.py -megatron/core/distributed/param_and_grad_buffer.py -megatron/core/distributed/reduce_scatter_with_fp32_accumulation.py -megatron/core/distributed/torch_fully_sharded_data_parallel.py -megatron/core/distributed/torch_fully_sharded_data_parallel_config.py -megatron/core/distributed/fsdp/__init__.py -megatron/core/distributed/fsdp/mcore_fsdp_adapter.py -megatron/core/distributed/fsdp/src/__init__.py -megatron/core/distributed/fsdp/src/megatron_fsdp/__init__.py -megatron/core/distributed/fsdp/src/megatron_fsdp/distributed_data_parallel_config.py -megatron/core/distributed/fsdp/src/megatron_fsdp/fully_shard.py -megatron/core/distributed/fsdp/src/megatron_fsdp/megatron_fsdp.py -megatron/core/distributed/fsdp/src/megatron_fsdp/mixed_precision.py -megatron/core/distributed/fsdp/src/megatron_fsdp/package_info.py -megatron/core/distributed/fsdp/src/megatron_fsdp/param_and_grad_buffer.py -megatron/core/distributed/fsdp/src/megatron_fsdp/uneven_dtensor.py -megatron/core/distributed/fsdp/src/megatron_fsdp/utils.py -megatron/core/export/__init__.py -megatron/core/export/data_type.py -megatron/core/export/export_config.py -megatron/core/export/model_type.py -megatron/core/export/trtllm/__init__.py -megatron/core/export/trtllm/trt_model_config.py -megatron/core/export/trtllm/trt_model_type.py -megatron/core/export/trtllm/trtllm_helper.py -megatron/core/export/trtllm/trtllm_layers.py -megatron/core/export/trtllm/engine_builder/__init__.py -megatron/core/export/trtllm/engine_builder/trtllm_engine_builder.py -megatron/core/export/trtllm/model_to_trllm_mapping/__init__.py -megatron/core/export/trtllm/model_to_trllm_mapping/default_conversion_dict.py -megatron/core/export/trtllm/trtllm_weights_converter/__init__.py -megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py -megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py -megatron/core/export/trtllm/trtllm_weights_converter/utils.py -megatron/core/extensions/__init__.py -megatron/core/extensions/kitchen.py -megatron/core/extensions/transformer_engine.py -megatron/core/extensions/transformer_engine_spec_provider.py -megatron/core/fusions/__init__.py -megatron/core/fusions/fused_bias_dropout.py -megatron/core/fusions/fused_bias_geglu.py -megatron/core/fusions/fused_bias_gelu.py -megatron/core/fusions/fused_bias_swiglu.py -megatron/core/fusions/fused_cross_entropy.py -megatron/core/fusions/fused_indices_converter.py -megatron/core/fusions/fused_layer_norm.py -megatron/core/fusions/fused_mla_yarn_rope_apply.py -megatron/core/fusions/fused_pad_routing_map.py -megatron/core/fusions/fused_softmax.py -megatron/core/fusions/fused_weighted_squared_relu.py -megatron/core/inference/__init__.py -megatron/core/inference/async_stream.py -megatron/core/inference/batch_dimensions_utils.py -megatron/core/inference/common_inference_params.py -megatron/core/inference/communication_utils.py -megatron/core/inference/config.py -megatron/core/inference/data_parallel_inference_coordinator.py -megatron/core/inference/headers.py -megatron/core/inference/inference_client.py -megatron/core/inference/inference_request.py -megatron/core/inference/sampling_params.py -megatron/core/inference/scheduler.py -megatron/core/inference/symmetric_memory.py -megatron/core/inference/unified_memory.py -megatron/core/inference/utils.py -megatron/core/inference/communication/torch_symm_triton/__init__.py -megatron/core/inference/communication/torch_symm_triton/barrier.py -megatron/core/inference/communication/torch_symm_triton/collectives.py -megatron/core/inference/communication/torch_symm_triton/fused_collectives.py -megatron/core/inference/communication/torch_symm_triton/multimem_asm.py -megatron/core/inference/communication/torch_symm_triton/utils.py -megatron/core/inference/contexts/__init__.py -megatron/core/inference/contexts/base_context.py -megatron/core/inference/contexts/dynamic_context.py -megatron/core/inference/contexts/fused_kv_append_kernel.py -megatron/core/inference/contexts/kv_block_allocator.py -megatron/core/inference/contexts/mamba_slot_allocator.py -megatron/core/inference/contexts/routing_metadata.py -megatron/core/inference/contexts/static_context.py -megatron/core/inference/contexts/attention_context/mamba_metadata.py -megatron/core/inference/contexts/attention_context/metadata_base.py -megatron/core/inference/contexts/attention_context/mha_metadata.py -megatron/core/inference/contexts/attention_context/triton/tensor_ops.py -megatron/core/inference/engines/__init__.py -megatron/core/inference/engines/abstract_engine.py -megatron/core/inference/engines/async_zmq_communicator.py -megatron/core/inference/engines/dynamic_engine.py -megatron/core/inference/engines/mcore_engine.py -megatron/core/inference/engines/static_engine.py -megatron/core/inference/model_inference_wrappers/__init__.py -megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/gpt/__init__.py -megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/multimodal/vlm_inference_wrapper.py -megatron/core/inference/model_inference_wrappers/t5/__init__.py -megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py -megatron/core/inference/moe/__init__.py -megatron/core/inference/moe/activations.py -megatron/core/inference/moe/fused_moe.py -megatron/core/inference/moe/pad.py -megatron/core/inference/moe/permute.py -megatron/core/inference/quantization/__init__.py -megatron/core/inference/quantization/mxfp8_quantize.py -megatron/core/inference/quantization/mxfp8_tensor.py -megatron/core/inference/quantization/utils.py -megatron/core/inference/text_generation_controllers/__init__.py -megatron/core/inference/text_generation_controllers/encoder_decoder_text_generation_controller.py -megatron/core/inference/text_generation_controllers/text_generation_controller.py -megatron/core/inference/text_generation_controllers/vlm_text_generation_controller.py -megatron/core/inference/text_generation_server/__init__.py -megatron/core/inference/text_generation_server/run_mcore_engine.py -megatron/core/inference/text_generation_server/text_generation_server.py -megatron/core/inference/text_generation_server/tokenization.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/__init__.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/text_generation_server.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/tokenization.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/__init__.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/chat_completions.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/common.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/completions.py -megatron/core/inference/text_generation_server/dynamic_text_gen_server/endpoints/health.py -megatron/core/inference/text_generation_server/endpoints/common.py -megatron/core/inference/text_generation_server/endpoints/completions.py -megatron/core/models/__init__.py -megatron/core/models/backends.py -megatron/core/models/T5/__init__.py -megatron/core/models/T5/t5_model.py -megatron/core/models/T5/t5_spec.py -megatron/core/models/bert/__init__.py -megatron/core/models/bert/bert_layer_specs.py -megatron/core/models/bert/bert_lm_head.py -megatron/core/models/bert/bert_model.py -megatron/core/models/bert/pooler.py -megatron/core/models/common/__init__.py -megatron/core/models/common/model_chunk_schedule_plan.py -megatron/core/models/common/embeddings/__init__.py -megatron/core/models/common/embeddings/language_model_embedding.py -megatron/core/models/common/embeddings/relative_pos_embedding.py -megatron/core/models/common/embeddings/rope_utils.py -megatron/core/models/common/embeddings/rotary_pos_embedding.py -megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py -megatron/core/models/common/language_module/__init__.py -megatron/core/models/common/language_module/language_module.py -megatron/core/models/common/vision_module/__init__.py -megatron/core/models/common/vision_module/vision_module.py -megatron/core/models/gpt/__init__.py -megatron/core/models/gpt/experimental_attention_variant_module_specs.py -megatron/core/models/gpt/fine_grained_callables.py -megatron/core/models/gpt/gpt_layer_specs.py -megatron/core/models/gpt/gpt_model.py -megatron/core/models/gpt/moe_module_specs.py -megatron/core/models/gpt/heterogeneous/heterogeneous_layer_specs.py -megatron/core/models/huggingface/__init__.py -megatron/core/models/huggingface/clip_model.py -megatron/core/models/huggingface/module.py -megatron/core/models/huggingface/qwen_model.py -megatron/core/models/mamba/__init__.py -megatron/core/models/mamba/mamba_layer_specs.py -megatron/core/models/mamba/mamba_model.py -megatron/core/models/mimo/__init__.py -megatron/core/models/mimo/optimizer.py -megatron/core/models/mimo/config/__init__.py -megatron/core/models/mimo/config/base_configs.py -megatron/core/models/mimo/config/role.py -megatron/core/models/mimo/model/__init__.py -megatron/core/models/mimo/model/base.py -megatron/core/models/mimo/partition/utils.py -megatron/core/models/mimo/submodules/audio.py -megatron/core/models/mimo/submodules/base.py -megatron/core/models/mimo/submodules/vision.py -megatron/core/models/multimodal/__init__.py -megatron/core/models/multimodal/context_parallel.py -megatron/core/models/multimodal/llava_model.py -megatron/core/models/multimodal/llava_spec.py -megatron/core/models/vision/__init__.py -megatron/core/models/vision/clip_vit_model.py -megatron/core/models/vision/multimodal_projector.py -megatron/core/models/vision/radio.py -megatron/core/models/vision/vit_layer_specs.py -megatron/core/optimizer/__init__.py -megatron/core/optimizer/clip_grads.py -megatron/core/optimizer/distrib_optimizer.py -megatron/core/optimizer/emerging_optimizers.py -megatron/core/optimizer/grad_scaler.py -megatron/core/optimizer/layer_wise_optimizer.py -megatron/core/optimizer/muon.py -megatron/core/optimizer/optimizer.py -megatron/core/optimizer/optimizer_config.py -megatron/core/optimizer/optimizer_cuda_graph.py -megatron/core/optimizer/qk_clip.py -megatron/core/optimizer/cpu_offloading/__init__.py -megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py -megatron/core/pipeline_parallel/__init__.py -megatron/core/pipeline_parallel/bridge_communicator.py -megatron/core/pipeline_parallel/combined_1f1b.py -megatron/core/pipeline_parallel/fine_grained_activation_offload.py -megatron/core/pipeline_parallel/hybrid_cp_schedule.py -megatron/core/pipeline_parallel/multimodule_communicator.py -megatron/core/pipeline_parallel/p2p_communication.py -megatron/core/pipeline_parallel/schedules.py -megatron/core/pipeline_parallel/utils.py -megatron/core/post_training/__init__.py -megatron/core/post_training/modelopt/__init__.py -megatron/core/post_training/modelopt/layers.py -megatron/core/post_training/modelopt/gpt/__init__.py -megatron/core/post_training/modelopt/gpt/model_specs.py -megatron/core/post_training/modelopt/gpt/state_dict_hooks.py -megatron/core/post_training/modelopt/mamba/__init__.py -megatron/core/post_training/modelopt/mamba/model_specs.py -megatron/core/quantization/__init__.py -megatron/core/quantization/quant_config.py -megatron/core/quantization/utils.py -megatron/core/resharding/__init__.py -megatron/core/resharding/execution.py -megatron/core/resharding/planner.py -megatron/core/resharding/refit.py -megatron/core/resharding/transforms.py -megatron/core/resharding/utils.py -megatron/core/resharding/copy_services/__init__.py -megatron/core/resharding/copy_services/base.py -megatron/core/resharding/copy_services/gloo_copy_service.py -megatron/core/resharding/copy_services/nccl_copy_service.py -megatron/core/resharding/copy_services/nvshmem_copy_service.py -megatron/core/resharding/nvshmem_copy_service/__init__.py -megatron/core/resharding/nvshmem_copy_service/compat.py -megatron/core/resharding/nvshmem_copy_service/logger.py -megatron/core/resharding/nvshmem_copy_service/nvshmem_types.py -megatron/core/resharding/nvshmem_copy_service/service.py -megatron/core/resharding/nvshmem_copy_service/validation.py -megatron/core/resharding/nvshmem_copy_service/core/__init__.py -megatron/core/resharding/nvshmem_copy_service/core/gpu_resource_manager.py -megatron/core/resharding/nvshmem_copy_service/core/kernel_launcher.py -megatron/core/resharding/nvshmem_copy_service/core/pipeline_executor.py -megatron/core/resharding/nvshmem_copy_service/memory/__init__.py -megatron/core/resharding/nvshmem_copy_service/memory/double_buffer_manager.py -megatron/core/resharding/nvshmem_copy_service/memory/tensor_pointer_utils.py -megatron/core/resharding/nvshmem_copy_service/planning/__init__.py -megatron/core/resharding/nvshmem_copy_service/planning/communication_scheduler.py -megatron/core/resharding/nvshmem_copy_service/planning/gpu_execution_planner.py -megatron/core/resharding/nvshmem_copy_service/planning/task_segmenter.py -megatron/core/resharding/nvshmem_copy_service/planning/workload_packer.py -megatron/core/ssm/__init__.py -megatron/core/ssm/gated_delta_net.py -megatron/core/ssm/mamba_block.py -megatron/core/ssm/mamba_context_parallel.py -megatron/core/ssm/mamba_hybrid_layer_allocation.py -megatron/core/ssm/mamba_layer.py -megatron/core/ssm/mamba_mixer.py -megatron/core/ssm/mlp_layer.py -megatron/core/ssm/triton_cache_manager.py -megatron/core/ssm/ops/__init__.py -megatron/core/ssm/ops/causal_conv1d_triton.py -megatron/core/ssm/ops/causal_conv1d_varlen.py -megatron/core/ssm/ops/determinism.py -megatron/core/ssm/ops/mamba_ssm.py -megatron/core/ssm/ops/ssd_bmm.py -megatron/core/ssm/ops/ssd_chunk_scan.py -megatron/core/ssm/ops/ssd_chunk_state.py -megatron/core/ssm/ops/ssd_combined.py -megatron/core/ssm/ops/ssd_state_passing.py -megatron/core/tensor_parallel/__init__.py -megatron/core/tensor_parallel/cross_entropy.py -megatron/core/tensor_parallel/data.py -megatron/core/tensor_parallel/inference_layers.py -megatron/core/tensor_parallel/layers.py -megatron/core/tensor_parallel/mappings.py -megatron/core/tensor_parallel/random.py -megatron/core/tensor_parallel/utils.py -megatron/core/tokenizers/__init__.py -megatron/core/tokenizers/base_tokenizer.py -megatron/core/tokenizers/megatron_tokenizer.py -megatron/core/tokenizers/text/__init__.py -megatron/core/tokenizers/text/text_tokenizer.py -megatron/core/tokenizers/text/libraries/__init__.py -megatron/core/tokenizers/text/libraries/abstract_tokenizer.py -megatron/core/tokenizers/text/libraries/bytelevel_tokenizer.py -megatron/core/tokenizers/text/libraries/chat_template.py -megatron/core/tokenizers/text/libraries/huggingface_tokenizer.py -megatron/core/tokenizers/text/libraries/megatron_hf_tokenizer.py -megatron/core/tokenizers/text/libraries/null_tokenizer.py -megatron/core/tokenizers/text/libraries/sentencepiece_tokenizer.py -megatron/core/tokenizers/text/libraries/sft_tokenizer.py -megatron/core/tokenizers/text/libraries/tiktoken_tokenizer.py -megatron/core/tokenizers/text/models/__init__.py -megatron/core/tokenizers/text/models/bert_tokenizer.py -megatron/core/tokenizers/text/models/default_tokenizer.py -megatron/core/tokenizers/text/models/gpt_tokenizer.py -megatron/core/tokenizers/text/models/mamba_tokenizer.py -megatron/core/tokenizers/text/models/t5_tokenizer.py -megatron/core/tokenizers/text/parsers/__init__.py -megatron/core/tokenizers/text/parsers/base_parser.py -megatron/core/tokenizers/text/parsers/deepseek_r1_reasoning_parser.py -megatron/core/tokenizers/text/parsers/qwen3_coder_tool_parser.py -megatron/core/tokenizers/utils/build_tokenizer.py -megatron/core/tokenizers/vision/__init__.py -megatron/core/tokenizers/vision/vision_tokenizer.py -megatron/core/tokenizers/vision/libraries/__init__.py -megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py -megatron/core/tokenizers/vision/libraries/null_multimodal_tokenizer.py -megatron/core/tokenizers/vision/models/__init__.py -megatron/core/tokenizers/vision/models/default_tokenizer.py -megatron/core/transformer/__init__.py -megatron/core/transformer/attention.py -megatron/core/transformer/cuda_graphs.py -megatron/core/transformer/dot_product_attention.py -megatron/core/transformer/enums.py -megatron/core/transformer/fsdp_dtensor_checkpoint.py -megatron/core/transformer/identity_op.py -megatron/core/transformer/mlp.py -megatron/core/transformer/module.py -megatron/core/transformer/multi_latent_attention.py -megatron/core/transformer/multi_token_prediction.py -megatron/core/transformer/pipeline_parallel_layer_layout.py -megatron/core/transformer/spec_utils.py -megatron/core/transformer/torch_layer_norm.py -megatron/core/transformer/torch_norm.py -megatron/core/transformer/transformer_block.py -megatron/core/transformer/transformer_config.py -megatron/core/transformer/transformer_layer.py -megatron/core/transformer/utils.py -megatron/core/transformer/custom_layers/__init__.py -megatron/core/transformer/custom_layers/batch_invariant_kernels.py -megatron/core/transformer/experimental_attention_variant/absorbed_mla.py -megatron/core/transformer/experimental_attention_variant/dsa.py -megatron/core/transformer/heterogeneous/heterogeneous_config.py -megatron/core/transformer/heterogeneous/linear_replacements.py -megatron/core/transformer/moe/__init__.py -megatron/core/transformer/moe/experts.py -megatron/core/transformer/moe/fused_a2a.py -megatron/core/transformer/moe/moe_layer.py -megatron/core/transformer/moe/moe_utils.py -megatron/core/transformer/moe/router.py -megatron/core/transformer/moe/router_replay.py -megatron/core/transformer/moe/shared_experts.py -megatron/core/transformer/moe/token_dispatcher.py -megatron/core/transformer/moe/token_dispatcher_inference.py -megatron/core/transformer/moe/upcycling_utils.py -megatron/training/__init__.py -megatron/training/argument_utils.py -megatron/training/arguments.py -megatron/training/async_utils.py -megatron/training/checkpointing.py -megatron/training/dgrad_logging.py -megatron/training/dist_signal_handler.py -megatron/training/ft_integration.py -megatron/training/global_vars.py -megatron/training/initialize.py -megatron/training/inprocess_restart.py -megatron/training/log_handler.py -megatron/training/one_logger_utils.py -megatron/training/theoretical_memory_usage.py -megatron/training/training.py -megatron/training/utils.py -megatron/training/wandb_utils.py -megatron/training/yaml_arguments.py -megatron/training/config/__init__.py -megatron/training/config/common_config.py -megatron/training/config/resilience_config.py -megatron/training/config/training_config.py -megatron/training/datasets/__init__.py -megatron/training/datasets/data_samplers.py -megatron/training/datasets/fim_dataset.py -megatron/training/datasets/sft_dataset.py -megatron_core.egg-info/PKG-INFO -megatron_core.egg-info/SOURCES.txt -megatron_core.egg-info/dependency_links.txt -megatron_core.egg-info/requires.txt -megatron_core.egg-info/top_level.txt \ No newline at end of file diff --git a/megatron_core.egg-info.bak/dependency_links.txt b/megatron_core.egg-info.bak/dependency_links.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/megatron_core.egg-info.bak/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/megatron_core.egg-info.bak/requires.txt b/megatron_core.egg-info.bak/requires.txt deleted file mode 100644 index 50312bd5967..00000000000 --- a/megatron_core.egg-info.bak/requires.txt +++ /dev/null @@ -1,65 +0,0 @@ -torch>=2.6.0 -numpy -packaging>=24.2 - -[dev] -transformer-engine[core_cu13,pytorch] -nvidia-resiliency-ext -tqdm -einops~=0.8 -tensorstore!=0.1.46,!=0.1.72,~=0.1 -nvtx~=0.2 -multi-storage-client~=0.27 -opentelemetry-api~=1.33.1 -mamba-ssm~=2.2 -causal-conv1d~=1.5 -flash-linear-attention~=0.4.0 -megatron-energon[av_decode]~=6.0 -av -flashinfer-python~=0.5.0 -wget -onnxscript -fastapi~=0.50 -datasets -emerging_optimizers -hypercorn -quart -openai[aiohttp] -orjson - -[dev:sys_platform != "darwin"] -nvidia-modelopt[torch] - -[lts] -tqdm -einops~=0.8 -tensorstore!=0.1.46,!=0.1.72,~=0.1 -nvtx~=0.2 -multi-storage-client~=0.27 -opentelemetry-api~=1.33.1 -mamba-ssm~=2.2 -causal-conv1d~=1.5 -megatron-energon[av_decode]~=6.0 -av -flashinfer-python~=0.5.0 -wget -onnxscript -fastapi~=0.50 -datasets -emerging_optimizers - -[mlm] -flask-restful -sentencepiece -tiktoken -wandb -transformers -accelerate - -[training] -flask-restful -sentencepiece -tiktoken -wandb -transformers -accelerate diff --git a/megatron_core.egg-info.bak/top_level.txt b/megatron_core.egg-info.bak/top_level.txt deleted file mode 100644 index 3bfbb11f4a7..00000000000 --- a/megatron_core.egg-info.bak/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -megatron From 7f4120a75f94eb7f7a35afab53a208d4c461f1d5 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Tue, 5 May 2026 13:24:41 -0700 Subject: [PATCH 09/12] switch back to initial solution Signed-off-by: dimapihtar --- .../vision/libraries/multimodal_tokenizer.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 088f635a6b5..967044ae1ec 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -251,15 +251,15 @@ def tokenize_conversation( # Apply possible image tag. conversation = self._apply_image_tag(conversation) - tokens = self.tokenizer.apply_chat_template( - conversation, - tokenize=True, - add_generation_prompt=add_generation_prompt, - return_assistant_token_mask=False, - return_tensors="np", - return_dict=False, - chat_template=self._prompt_config.custom_chat_template, - )[0] + tokens = np.array( + self.tokenizer.apply_chat_template( + conversation, + tokenize=True, + add_generation_prompt=add_generation_prompt, + return_assistant_token_mask=False, + chat_template=self._prompt_config.custom_chat_template, + ) + ) if not return_target: return tokens From c6361d6c194c1ee1fc492c63632aeb9866ac88ea Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Wed, 6 May 2026 05:22:50 -0700 Subject: [PATCH 10/12] set return_dict=False Signed-off-by: dimapihtar --- .../vision/libraries/multimodal_tokenizer.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 967044ae1ec..088f635a6b5 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -251,15 +251,15 @@ def tokenize_conversation( # Apply possible image tag. conversation = self._apply_image_tag(conversation) - tokens = np.array( - self.tokenizer.apply_chat_template( - conversation, - tokenize=True, - add_generation_prompt=add_generation_prompt, - return_assistant_token_mask=False, - chat_template=self._prompt_config.custom_chat_template, - ) - ) + tokens = self.tokenizer.apply_chat_template( + conversation, + tokenize=True, + add_generation_prompt=add_generation_prompt, + return_assistant_token_mask=False, + return_tensors="np", + return_dict=False, + chat_template=self._prompt_config.custom_chat_template, + )[0] if not return_target: return tokens From 0af70f8a222f819d0921727e52c248b5f5156573 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Wed, 6 May 2026 05:27:17 -0700 Subject: [PATCH 11/12] fix unit test by setting return_dict=False Signed-off-by: dimapihtar --- .../core/tokenizers/vision/libraries/multimodal_tokenizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index 088f635a6b5..a4d6fcbf845 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -273,7 +273,7 @@ def tokenize_conversation( raise ValueError(f"empty turn in conversation: {conversation}. Skipping.") turn_tokens = self.tokenizer.apply_chat_template( - [turn], tokenize=True, chat_template=self._prompt_config.custom_chat_template + [turn], tokenize=True, return_dict=False, chat_template=self._prompt_config.custom_chat_template ) # There should be only one BOS at the very beginning. From 734841b87edad874c607b71e30b1b209562e3e45 Mon Sep 17 00:00:00 2001 From: dimapihtar Date: Wed, 6 May 2026 05:35:26 -0700 Subject: [PATCH 12/12] minor change Signed-off-by: dimapihtar --- .../core/tokenizers/vision/libraries/multimodal_tokenizer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py index a4d6fcbf845..f939a488cc2 100644 --- a/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py +++ b/megatron/core/tokenizers/vision/libraries/multimodal_tokenizer.py @@ -273,7 +273,10 @@ def tokenize_conversation( raise ValueError(f"empty turn in conversation: {conversation}. Skipping.") turn_tokens = self.tokenizer.apply_chat_template( - [turn], tokenize=True, return_dict=False, chat_template=self._prompt_config.custom_chat_template + [turn], + tokenize=True, + return_dict=False, + chat_template=self._prompt_config.custom_chat_template, ) # There should be only one BOS at the very beginning.