{"id":22656509,"url":"https://github.com/johanli233/pytorchmetaldemo","last_synced_at":"2026-04-29T17:39:46.195Z","repository":{"id":266809177,"uuid":"899418612","full_name":"JohanLi233/PyTorchMetalDemo","owner":"JohanLi233","description":"This is a simple demo that implements a custom operation in PyTorch that uses Metal kernels in cpp.","archived":false,"fork":false,"pushed_at":"2024-12-07T08:43:16.000Z","size":209,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T07:44:56.141Z","etag":null,"topics":["metal","mps","pytorch"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohanLi233.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-12-06T08:21:10.000Z","updated_at":"2025-02-18T02:53:24.000Z","dependencies_parsed_at":"2024-12-06T09:27:03.841Z","dependency_job_id":"8439b839-19cb-4664-a469-d70b8bb6d02a","html_url":"https://github.com/JohanLi233/PyTorchMetalDemo","commit_stats":null,"previous_names":["johanli233/pytorchmetaldemo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanLi233%2FPyTorchMetalDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanLi233%2FPyTorchMetalDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanLi233%2FPyTorchMetalDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanLi233%2FPyTorchMetalDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohanLi233","download_url":"https://codeload.github.com/JohanLi233/PyTorchMetalDemo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156029,"owners_count":20732359,"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","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":["metal","mps","pytorch"],"created_at":"2024-12-09T10:14:44.121Z","updated_at":"2026-04-29T17:39:46.189Z","avatar_url":"https://github.com/JohanLi233.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorchMetalDemo\n\nPyTorchMetalDemo is a demonstration project showcasing how to use Apple's Metal API with PyTorch to perform custom tensor operations on macOS devices with MPS (Metal Performance Shaders) support.\n\n## Features\n\n- Implements a custom tensor fill operation using Metal.\n- Implements a custom tensor add operation using Metal.\n- Demonstrates integration of Metal with PyTorch.\n\n## Requirements\n\n- macOS with Metal support\n- PyTorch with MPS backend support\n- Xcode command line tools\n- Python 3.12\n- uv package manager (https://github.com/astral-sh/uv) or any other python package manager\n\n## Metal CPP\n\nThe metal-cpp package was downloaded from [here](https://developer.apple.com/metal/cpp/#:~:text=1.%20Prepare%20your%20Mac.). If you are not using macOS 15, please download the appropriate version from [this link](https://developer.apple.com/metal/cpp/#:~:text=1.%20Prepare%20your%20Mac.).\n\n# Check [Real Use Cases of Customizing kernels Here](https://github.com/JohanLi233/causal-conv1d-mps)\n\n## Usage\n\n``` bash\n\n   git clone https://github.com/JohanLi233/PyTorchMetalDemo.git\n   \n   cd PyTorchMetalDemo\n\n   # create venv\n   uv venv --python=3.12\n   source .venv/bin/activate\n\n   uv pip install -r requirements.txt\n   \n   uv pip install -e .\n   \n   python test.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanli233%2Fpytorchmetaldemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohanli233%2Fpytorchmetaldemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanli233%2Fpytorchmetaldemo/lists"}