{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-multi-level-superoptimizer-for-tensor","title":"Mirage: A Multi-Level Superoptimizer for Tensor Programs","arxiv_id":"2405.05751","date":"2024-05-09","proceeding":null,"authors":["Mengdi Wu","Xinhao Cheng","Shengyu Liu","Chunan Shi","Jianan Ji","Kit Ao","Praveen Velliengiri","Xupeng Miao","Oded Padon","Zhihao Jia"],"abstract":"We introduce Mirage, the first multi-level superoptimizer for tensor programs. A key idea in Mirage is $\\mu$Graphs, a uniform representation of tensor programs at the kernel, thread block, and thread levels of the GPU compute hierarchy. $\\mu$Graphs enable Mirage to discover novel optimizations that combine algebraic transformations, schedule transformations, and generation of new custom kernels. To navigate the large search space, Mirage introduces a pruning technique based on abstraction that significantly reduces the search space and provides a certain optimality guarantee. To ensure that the optimized $\\mu$Graph is equivalent to the input program, Mirage introduces a probabilistic equivalence verification procedure with strong theoretical guarantees. Our evaluation shows that Mirage outperforms existing approaches by up to 3.3$\\times$ even for DNNs that are widely used and heavily optimized. Mirage is publicly available at https://github.com/mirage-project/mirage.","url_abs":"https://arxiv.org/abs/2405.05751v3","url_pdf":"https://arxiv.org/pdf/2405.05751v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-multi-level-superoptimizer-for-tensor","repo_url":"https://github.com/mirage-project/mirage","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"navigate","task_name":"Navigate"}],"methods":[{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.05751","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.05751"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mirage-project/mirage","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":8,"unverified":3},"by_repo_kind":{"official":{"samples":11,"ran":8,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"7b480c4ac3023f72","entry":"check_stride","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/kernel.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/kernel.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7b480c4ac3023f72"}},{"code_sha256_prefix":"cef40499cf065020","entry":"decode_tag","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/profiler.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/profiler.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cef40499cf065020"}},{"code_sha256_prefix":"9caa520c6c1a019a","entry":"gen_empty_tensor","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/kernel.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/kernel.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9caa520c6c1a019a"}},{"code_sha256_prefix":"0ecdc2aa68b5b2b4","entry":"get_cc_cmd","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/kernel.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/kernel.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0ecdc2aa68b5b2b4"}},{"code_sha256_prefix":"da8a9e6ba7c9cece","entry":"get_format_str","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/visualizer.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/visualizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"da8a9e6ba7c9cece"}},{"code_sha256_prefix":"fa9480318ea67b0c","entry":"get_scheduler","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/utils.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fa9480318ea67b0c"}},{"code_sha256_prefix":"9140e6b567f2889f","entry":"get_shared_memory_capacity","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/utils.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9140e6b567f2889f"}},{"code_sha256_prefix":"c0dfdf08d5ad9257","entry":"is_graph_data","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/visualizer.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/visualizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c0dfdf08d5ad9257"}},{"code_sha256_prefix":"6675ca92f6d07cc1","entry":"get_builder","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/mpk/model_registry.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/mpk/model_registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6675ca92f6d07cc1"}},{"code_sha256_prefix":"b70214a477fae3a4","entry":"get_configurations_from_gpu","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/utils.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b70214a477fae3a4"}},{"code_sha256_prefix":"45a7a84f44c207b0","entry":"profile_and_select_best_graph","repo":"mirage-project/mirage","repo_kind":"official","path":"python/mirage/triton_profiler.py","file_url":"https://github.com/mirage-project/mirage/blob/HEAD/python/mirage/triton_profiler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"45a7a84f44c207b0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}