{"id":43677312,"url":"https://github.com/d9d-project/d9d","last_synced_at":"2026-04-14T01:01:57.887Z","repository":{"id":333588154,"uuid":"1115396830","full_name":"d9d-project/d9d","owner":"d9d-project","description":"d9d - d[istribute]d - distributed training framework based on PyTorch that tries to be efficient yet hackable","archived":false,"fork":false,"pushed_at":"2026-04-13T00:56:55.000Z","size":4135,"stargazers_count":14,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T02:28:49.481Z","etag":null,"topics":["ai","cuda","distributed","distributed-systems","llm","pytorch"],"latest_commit_sha":null,"homepage":"https://d9d-project.github.io/d9d/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d9d-project.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-12T19:52:27.000Z","updated_at":"2026-04-13T00:57:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/d9d-project/d9d","commit_stats":null,"previous_names":["d9d-project/d9d"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/d9d-project/d9d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d9d-project%2Fd9d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d9d-project%2Fd9d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d9d-project%2Fd9d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d9d-project%2Fd9d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d9d-project","download_url":"https://codeload.github.com/d9d-project/d9d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d9d-project%2Fd9d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31777348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cuda","distributed","distributed-systems","llm","pytorch"],"created_at":"2026-02-05T01:14:48.886Z","updated_at":"2026-04-14T01:01:57.882Z","avatar_url":"https://github.com/d9d-project.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The d9d Project\n\n**d9d** is a distributed training framework built on top of PyTorch 2.0. It aims to be hackable, modular, and efficient, designed to scale from single-GPU debugging to massive clusters running 6D-Parallelism.\n\n[LET'S START TRAINING 🚀](https://d9d-project.github.io/d9d/)\n\n## Installation\n\nJust use your favourite package manager:\n```bash\npip install d9d\npoetry add d9d\nuv add d9d\n```\n\n### Extras\n\n* `d9d[aim]`: [Aim](https://aimstack.io/) experiment tracker integration.\n* `d9d[visualization]`: Plotting libraries required to some advanced visualization functionality.\n* `d9d[linear-attention]`: Efficient Linear Attention kernels.\n* `d9d[moe]`: Efficient Mixture of Experts GPU kernels. You should build and install some dependencies manually before installation: [DeepEP](https://github.com/deepseek-ai/DeepEP), [grouped-gemm](https://github.com/fanshiqing/grouped_gemm/).\n* `d9d[cce]`: Efficient Fused Cross-Entropy kernels. You should build and install some dependencies manually before installation: [Cut Cross Entropy](https://github.com/apple/ml-cross-entropy).\n\n## Examples\n\n* **[Qwen3-MoE Pretraining](https://github.com/d9d-project/d9d/blob/main/example/qwen3_moe/pretrain.py):** an example showing causal LM pretraining for the Qwen3-MoE model.\n\n---\n\n## About\n\n### Why another framework?\n\nDistributed training frameworks such as **Megatron-LM** are monolithic in the way you run a script from the command line to train any of a set of *predefined* models, using *predefined* regimes. While powerful, these systems can be difficult to hack and integrate into novel research workflows. Their focus is often on providing a complete, end-to-end solution, which can limit flexibility for experimentally-driven research.\n\nConversely, creating your own distributed training solution from scratch is tricky. You have to implement many low-level components (like distributed checkpoints and synchronization) that are identical across setups, and manually tackle common performance bottlenecks.\n\n**d9d** was designed to fill the gap between monolithic frameworks and homebrew setups, providing a modular yet effective solution for distributed training.\n\n### What d9d is and isn't\n\nIn terms of **core concept**:\n\n*   **IS** a pluggable framework for implementing distributed training regimes for your deep learning models.\n*   **IS** built on clear interfaces and building blocks that may be composed and implemented in your own way.\n*   **IS NOT** an all-in-one CLI platform for setting up pre-training and post-training like **torchtitan**, **Megatron-LM**, or **torchforge**.\n\nIn terms of **codebase \u0026 engineering**:\n\n*   **IS** built on a **strong engineering foundation**: We enforce strict type-checking and rigorous linting to catch errors before execution.\n*   **IS** reliable: The framework is backed by a suite of **over 450 tests**, covering unit logic, integration flows, and End-to-End distributed scenarios.\n*   **IS** eager to use performance hacks (like **DeepEp** or custom kernels) if they improve MFU, even if they aren't PyTorch-native.\n*   **IS NOT** for legacy setups: We do not maintain backward compatibility with older PyTorch versions or hardware. We prioritize simplicity and modern APIs (like `DTensor`).\n\n### Key Philosophies\n\nTo achieve the balance between hackability and performance, d9d adheres to specific design principles:\n\n*   **Composition over Monoliths**: We avoid \"God Classes\" like `DistributedDataParallel` or `ParallelDims` that assume ownership of the entire execution loop. Instead, we provide composable and extendable APIs. For instance, specific horizontal parallelism strategies for specific layers (`parallelize_replicate`, `parallelize_expert_parallel`, ...).\n*   **White-Box Modelling**: We encourage standard PyTorch code. Models are not wrapped in obscure metadata specifications; they are standard `nn.Module`s that implement lightweight protocols.\n*   **Pragmatic Efficiency**: While we prefer native PyTorch, we are eager to integrate non-native solutions if they improve MFU. For example, we implement MoE using **DeepEp** communications, reindexing kernels from **Megatron-LM**, and efficient grouped-GEMM implementations.\n*   **Graph-Based State Management**: Our IO system treats model checkpoints as directed acyclic graphs. This allows you to transform architectures (e.g., merging `q`, `k`, `v` into `qkv`) on-the-fly while streaming from disk, without massive memory overhead.\n*   **DTensors**: We mandate that distributed parameters be represented as `torch.distributed.tensor.DTensor`. This simplifies checkpointing by making them topology-aware automatically. We leverage modern PyTorch 2.0 APIs (`DeviceMesh`) as much as possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd9d-project%2Fd9d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd9d-project%2Fd9d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd9d-project%2Fd9d/lists"}