{"id":27645840,"url":"https://github.com/kylesayrs/pttp","last_synced_at":"2026-05-07T04:43:53.167Z","repository":{"id":288490436,"uuid":"968245157","full_name":"kylesayrs/PTTP","owner":"kylesayrs","description":"PyTorch Tensor Profiler with fully-supported memory timelines and events","archived":false,"fork":false,"pushed_at":"2025-04-18T05:43:17.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T01:13:17.160Z","etag":null,"topics":["cuda","memory","profiling","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylesayrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-04-17T18:44:00.000Z","updated_at":"2025-04-18T14:35:12.000Z","dependencies_parsed_at":"2025-04-18T10:59:13.737Z","dependency_job_id":"13898ee8-bbdf-4b19-b429-6d122ddb8b9c","html_url":"https://github.com/kylesayrs/PTTP","commit_stats":null,"previous_names":["kylesayrs/pttp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylesayrs/PTTP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylesayrs%2FPTTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylesayrs%2FPTTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylesayrs%2FPTTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylesayrs%2FPTTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylesayrs","download_url":"https://codeload.github.com/kylesayrs/PTTP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylesayrs%2FPTTP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272965450,"owners_count":25023071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cuda","memory","profiling","pytorch"],"created_at":"2025-04-24T01:13:16.572Z","updated_at":"2026-05-07T04:43:48.127Z","avatar_url":"https://github.com/kylesayrs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch Tensor Profiler (PTTP) #\n**PyTorch Tensor Profiler (PTTP)** is a tool for accurately profiling the memory usage of PyTorch tensors. It measures the true memory footprint of tensors created by your program, without interference from higher-level abstractions like the Python garbage collector, PyTorch’s caching allocator, or the Linux virtual memory system.\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"75%\" src=\"assets/transformers_timeline.png\" alt=\"Example Memory Timeline\"/\u003e\n\u003c/p\u003e\n\n## Support ##\n* Tensor allocation and deallocation\n* Tensor dunder methods (+, -, *, /, ect.)\n* Tensor views which share the same storage\n* *As of now, there are no known methods of allocating tensor memory which is not captured by PTTP*\n\n## Usage ##\n```python\nimport gc\nimport torch\nfrom pttp import TensorProfiler\n\nwith TensorProfiler() as prof:\n    a = torch.randn(10)\n    b = torch.randn(10)\n    prof.mark_event(\"A and B allocated\")\n\n    c = a + b\n    prof.mark_event(\"C allocated\")\n    \n    del a, b; gc.collect()\n    prof.mark_event(\"A and B collected\")\n\nprof.save_memory_timeline(\"memory.png\")\nremaining_memory = prof.memory  # 40 bytes\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"75%\" src=\"assets/example_timeline.png\" alt=\"Example Memory Timeline\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylesayrs%2Fpttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylesayrs%2Fpttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylesayrs%2Fpttp/lists"}