{"id":46627314,"url":"https://github.com/traceopt-ai/traceml","last_synced_at":"2026-03-07T23:01:18.633Z","repository":{"id":310346580,"uuid":"1039530409","full_name":"traceopt-ai/traceml","owner":"traceopt-ai","description":"Lightweight training runtime health monitor","archived":false,"fork":false,"pushed_at":"2026-03-02T22:20:51.000Z","size":5072,"stargazers_count":97,"open_issues_count":6,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-03T00:44:01.191Z","etag":null,"topics":["ai","data-science","deep-learning","huggingface","machine-learning","mlops","observability","pytorch","runtime","runtime-system","straggler-problem","training"],"latest_commit_sha":null,"homepage":"https://traceopt.ai/","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/traceopt-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-08-17T12:46:51.000Z","updated_at":"2026-03-02T22:20:52.000Z","dependencies_parsed_at":"2025-12-14T00:06:21.127Z","dependency_job_id":null,"html_url":"https://github.com/traceopt-ai/traceml","commit_stats":null,"previous_names":["traceml-ai/traceml","traceopt-ai/traceml"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/traceopt-ai/traceml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traceopt-ai%2Ftraceml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traceopt-ai%2Ftraceml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traceopt-ai%2Ftraceml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traceopt-ai%2Ftraceml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traceopt-ai","download_url":"https://codeload.github.com/traceopt-ai/traceml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traceopt-ai%2Ftraceml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30236042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: 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","data-science","deep-learning","huggingface","machine-learning","mlops","observability","pytorch","runtime","runtime-system","straggler-problem","training"],"created_at":"2026-03-07T23:00:45.099Z","updated_at":"2026-03-07T23:01:18.607Z","avatar_url":"https://github.com/traceopt-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TraceML\n\n**Know what’s slowing your (PyTorch) training, while it runs**\n\n\n[![PyPI version](https://img.shields.io/pypi/v/traceml-ai.svg)](https://pypi.org/project/traceml-ai/)\n[![Downloads](https://static.pepy.tech/badge/traceml-ai)](https://pepy.tech/project/traceml-ai)\n[![GitHub stars](https://img.shields.io/github/stars/traceopt-ai/traceml?style=social)](https://github.com/traceopt-ai/traceml)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](./LICENSE)\n\nTraceML provides step-level training visibility for PyTorch workloads. It shows where time and memory go inside each training step so you can\nquickly understand performance behavior across single-GPU and  single-node DDP runs.\n\n**Current support**\n- ✅ Single GPU\n- ✅ Single-node multi-GPU (**DDP**)\n- ❌ Multi-node DDP (not yet)\n- ❌ FSDP / TP / PP (not yet)\n\n---\n\n## What You See in Minutes\n\n-   System signals (CPU, RAM, GPU)\n-   Breakdown of each training step:\n    -   `dataloader → forward → backward → optimizer → overhead`\n-   Median vs worst rank (in case of DDP)\n-   Skew (%) to surface imbalance\n-   GPU memory (allocated + peak)\n- End-of-run summary card with straggler rank and step breakdown\n\n\nHealthy runs are clearly stable. Unstable runs reveal drift, imbalance, or memory creep early.\n\n---\n## Quick Start\n\n\u003e **More detailed Quickstart:** [docs/quickstart.md](docs/quickstart.md) covers install, run modes, DDP, and troubleshooting.\n\nInstall:\n\n``` bash\npip install traceml-ai\n```\n\nWrap your training step:\n\n``` python\nfrom traceml.decorators import trace_step\n\nfor batch in dataloader:\n    with trace_step(model):\n        outputs = model(batch[\"x\"])\n        loss = criterion(outputs, batch[\"y\"])\n        loss.backward()\n        optimizer.step()\n        optimizer.zero_grad(set_to_none=True)\n```\n\nRun with cli:\n\n``` bash\ntraceml run train.py\n```\n\nThe terminal dashboard opens alongside your logs. At run end, TraceML also prints a compact runtime summary card for quick review and sharing.\n![TraceML terminal dashboard](cli_demo_v1.png)\n\n\n\n\nOptional web UI:\n\n``` bash\ntraceml run train.py --mode=dashboard\n```\n\n![TraceML web dashboard](web_demo_v1.png)\n\n---\n\n## What TraceML Surfaces\n\n### Step-Level Signals\n\n-   Dataloader fetch time\n-   Step time (low-overhead, GPU-aware)\n-   Step GPU memory (allocated + peak)\n\nAcross ranks:\n\n-   Median (typical behavior)\n-   Worst rank (slowest / highest memory)\n-   Skew (% difference)\n\nThis makes rank imbalance and straggler behavior immediately visible.\n\n---\n\n## Deep-Dive Mode (Optional)\n\nEnable model-level hooks for diagnostic context:\n\n``` python\nfrom traceml.decorators import trace_model_instance\ntrace_model_instance(model)\n```\n\nUse together with `trace_step(model)` to enable:\n\n-   Per-layer memory signals\n-   Per-layer forward/backward timing\n-   Lightweight failure attribution (experimental)\n\nIf not enabled, ESSENTIAL signals remain unchanged.\n\n---\n\n## What It Is Not\n\n-   Not a replacement for PyTorch Profiler or Nsight\n-   Not an auto-tuner\n-   Not a kernel-level tracer\n\nTraceML focuses on step-level visibility that is practical during real\ntraining runs.\n\n---\n\n## Supported Environments\n\n-   Python 3.10+\n-   PyTorch 2.5+\n-   macOS (Intel/ARM), Linux\n-   Single GPU\n-   Single-node DDP\n\n---\n\n## Hugging Face Integration\n\nTraceML provides a seamless integration with Hugging Face `transformers` via `TraceMLTrainer`.\n\n### Usage\n\nReplace `transformers.Trainer` with `traceml.hf_decorators.TraceMLTrainer`.\n\n```python\nfrom traceml.hf_decorators import TraceMLTrainer\n\ntrainer = TraceMLTrainer(\n    model=model,\n    args=training_args,\n    train_dataset=train_ds,\n    eval_dataset=eval_ds,\n    traceml_enabled=True,\n)\n```\n\nSee the full [Hugging Face integration guide](docs/huggingface.md) for NLP, vision, DDP examples, and a complete `TraceMLTrainer` parameter reference.\n\n---\n\n## PyTorch Lightning Integration\n\nTraceML offers official support for PyTorch Lightning models through `TraceMLCallback`.\n\n### Usage\n\nSimply pass the callback to your `Trainer`.\n\n```python\nimport lightning as L\nfrom traceml.utils.lightning import TraceMLCallback\nfrom traceml.decorators import trace_model_instance\n\nclass MyLightningModule(L.LightningModule):\n    def __init__(self):\n        super().__init__()\n        self.model = ...\n        # Optional: enable deep-dive per-layer instrumentation\n        trace_model_instance(self)\n\n    def training_step(self, batch, batch_idx):\n        ...\n\ntrainer = L.Trainer(callbacks=[TraceMLCallback()])\n```\n\n---\n\n## Roadmap\n\nNear-term: - Single-node DDP hardening - Disk run logging -\nCompatibility validation (gradient accumulation, torch.compile) -\nAccelerate / Lightning wrappers\n\nNext: - Multi-node DDP - Initial FSDP support\n\nLater: - Tensor / Pipeline parallel awareness\n\n\n\n\n---\n\n## Contributing\n\n\nContributions are welcome.\n\nWhen opening issues, include: - Minimal repro script - Hardware + CUDA +\nPyTorch versions - ESSENTIAL vs DEEP-DIVE - Single GPU vs DDP\n\n---\n\n## Community \u0026 Support\n\nFounding Engineer / Co-Founder track (Berlin/Germany): We are looking\nfor a senior systems+ML builder to help grow TraceML into a sustainable AI\ninfra product. See the GitHub Discussion https://github.com/traceopt-ai/traceml/discussions/36\n\n- 📧 Email: abhinav@traceopt.ai\n- 🐙 LinkedIn: [Abhinav Srivastav](https://www.linkedin.com/in/abhinavsriva/)\n- 📋 User Survey (2 min): https://forms.gle/KwPSLaPmJnJjoVXSA\n\nStars help more teams find the project. 🌟\n\n\u003ca href=\"https://www.star-history.com/#traceopt-ai/traceml\u0026type=date\u0026legend=top-left\"\u003e\n  \u003cimg src=\"https://api.star-history.com/svg?repos=traceopt-ai/traceml\u0026type=date\u0026legend=top-left\" width=\"50%\"\u003e\n\u003c/a\u003e\n\n---\n\n## License\n\nTraceML is released under the **Apache 2.0**.\n\nSee [LICENSE](./LICENSE) for details.\n\n---\n\n## Citation\n\nIf TraceML helps your research, please cite:\n\n```bibtex\n@software{traceml2024,\n  author = {TraceOpt},\n  title = {TraceML: Real-time Training Observability for PyTorch},\n  year = {2024},\n  url = {https://github.com/traceopt-ai/traceml}\n}\n```\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nMade with ❤️ by TraceOpt\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraceopt-ai%2Ftraceml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraceopt-ai%2Ftraceml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraceopt-ai%2Ftraceml/lists"}