{"id":13478608,"url":"https://github.com/google-deepmind/alphatensor","last_synced_at":"2025-04-14T08:53:33.779Z","repository":{"id":60858899,"uuid":"539939523","full_name":"google-deepmind/alphatensor","owner":"google-deepmind","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-22T20:57:33.000Z","size":7660,"stargazers_count":2729,"open_issues_count":8,"forks_count":244,"subscribers_count":56,"default_branch":"main","last_synced_at":"2025-04-10T04:02:23.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/google-deepmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-09-22T11:09:20.000Z","updated_at":"2025-04-09T06:38:17.000Z","dependencies_parsed_at":"2024-07-31T17:41:01.389Z","dependency_job_id":null,"html_url":"https://github.com/google-deepmind/alphatensor","commit_stats":null,"previous_names":["google-deepmind/alphatensor","deepmind/alphatensor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Falphatensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Falphatensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Falphatensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Falphatensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-deepmind","download_url":"https://codeload.github.com/google-deepmind/alphatensor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852107,"owners_count":21171839,"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":[],"created_at":"2024-07-31T16:01:59.343Z","updated_at":"2025-04-14T08:53:33.752Z","avatar_url":"https://github.com/google-deepmind.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# AlphaTensor\n\nThis is code accompanying the publication\n\n\u003e Fawzi, A. et al. [Discovering faster matrix multiplication algorithms with\nreinforcement learning](https://www.nature.com/articles/s41586-022-05172-4).\n*Nature* **610** (2022)\n\nThere are 4 independent directories:\n\n- `algorithms` contains algorithms discovered by AlphaTensor, represented as\nfactorizations of matrix multiplication tensors, and a Colab showing how to load\nthese.\n\n- `benchmarking` contains a script that can be used to measure the actual speed\nof matrix multiplication algorithms on an NVIDIA V100 GPU.\n\n- `nonequivalence` contains 14,236 nonequivalent algorithms discovered by\nAlphaTensor for the same matrix multiplication problem (multiplying 4x4\nmatrices), and a Colab that verifies their nonequivalence.\n\n- `recombination` contains the code we used to decompose larger matrix\nmultiplication tensors by recombining factorizations of smaller ones.\n\n\n## Installation\n\n- `algorithms`: No installation required.\n\n- `benchmarking`: See `README` in the subdirectory.\n\n- `nonequivalence`: No installation required.\n\n- `recombination`: A machine with Python 3 installed is required. The required\ndependencies (`numpy` and `absl-py`) can be installed by executing\n`pip3 install -r alphatensor/recombination/requirements.txt`.\n\n## Usage\n\n- `algorithms`: The notebook `explore_factorizations.ipynb` can be opened via\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deepmind/alphatensor/blob/master/algorithms/explore_factorizations.ipynb).\nWhen running the code, you will be asked to upload a file containing the\nfactorizations. Please select either of the compressed NumPy files\n`factorizations_r.npz` (containing algoritms in standard arithmetic) or\n`factorizations_f2.npz` (algorithms in arithmetic modulo 2).\n\n- `benchmarking`: See `README` in the subdirectory, and Supplement D of the\npaper.\n\n- `nonequivalence`: The notebook `inspect_factorizations_notebook.ipynb` can be\nopened via\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deepmind/alphatensor/blob/master/nonequivalence/inspect_factorizations_notebook.ipynb).\nWhen running the code, you will be asked to upload a file. Please select the\ncompressed NumPy file `alphatensor_14236_factorizations.npz`. This will upload\nthe factorizations found by AlphaTensor, and then compute invariants certifying\nthat they are all nonequivalent. For more details, see Supplement B of the\npaper.\n\n- `recombination`: Execute `python3 -m alphatensor.recombination.example` on the\ncommand line, **from the parent directory that contains the `alphatensor`\nrepository as a subdirectory**. For more details, see Supplement H of the paper.\n\n## Citing this work\n\nIf you use the code or data in this package, please cite:\n\n```bibtex\n@Article{AlphaTensor2022,\n  author  = {Fawzi, Alhussein and Balog, Matej and Huang, Aja and Hubert, Thomas and Romera-Paredes, Bernardino and Barekatain, Mohammadamin and Novikov, Alexander and Ruiz, Francisco J. R. and Schrittwieser, Julian and Swirszcz, Grzegorz and Silver, David and Hassabis, Demis and Kohli, Pushmeet},\n  journal = {Nature},\n  title   = {Discovering faster matrix multiplication algorithms with reinforcement learning},\n  year    = {2022},\n  volume  = {610},\n  number  = {7930},\n  pages   = {47--53},\n  doi     = {10.1038/s41586-022-05172-4}\n}\n```\n\n## License and disclaimer\n\nCopyright 2022 DeepMind Technologies Limited\n\nAll software is licensed under the Apache License, Version 2.0 (Apache 2.0);\nyou may not use this file except in compliance with the Apache 2.0 license.\nYou may obtain a copy of the Apache 2.0 license at:\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nAll other materials are licensed under the Creative Commons Attribution 4.0\nInternational License (CC-BY). You may obtain a copy of the CC-BY license at:\nhttps://creativecommons.org/licenses/by/4.0/legalcode\n\nUnless required by applicable law or agreed to in writing, all software and\nmaterials distributed here under the Apache 2.0 or CC-BY licenses are\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\neither express or implied. See the licenses for the specific language governing\npermissions and limitations under those licenses.\n\nThis is not an official Google product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Falphatensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-deepmind%2Falphatensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Falphatensor/lists"}