{"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/arxiv-2609-04105","title":"Hardware-Aware FP4 FlashAttention-4","arxiv_id":"2609.04105","date":"2026-09-03","proceeding":null,"authors":["Robert Hu"],"abstract":"Blackwell's 4-bit floating-point (FP4) tensor cores do not automatically make attention faster because softmax conversion and on-chip dependencies dominate once its matrix products shrink. We address this with \\emph{Direct-P} for noncausal inference and a causal path that passes the forward quantization directly into backward. Direct-P maps scores directly to FP4 probabilities and reaches up to 2.13$\\times$ the bfloat16 (BF16) forward throughput on an NVIDIA GB200. The causal path reconstructs probabilities from saved quantized queries and keys and uses 8-bit floating-point (FP8) gradient operands, accelerating a complete single-GPU 8-billion-parameter update by up to 1.14$\\times$. Matched distributed training retains FP8 probabilities and values; every tested MXFP4 probability/value training trajectory diverges.","url_abs":"https://arxiv.org/abs/2609.04105","url_pdf":"https://arxiv.org/pdf/2609.04105","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2609.04105","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2609.04105"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/MrHuff/fp4-fa4","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"unverified":21},"by_repo_kind":{"found_in_text":{"samples":22,"ran":1,"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":"cb1f4090fbd1ecb5","entry":"sha256_file","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.py","link_basis":"harvester_set","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":"cb1f4090fbd1ecb5"}},{"code_sha256_prefix":"9b8fa2e4fdd04098","entry":"as_finite","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.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":"9b8fa2e4fdd04098"}},{"code_sha256_prefix":"8e2a7cf9b7aded2c","entry":"collect_rows","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/build_summary.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":"8e2a7cf9b7aded2c"}},{"code_sha256_prefix":"f923592f03a7775c","entry":"confidence_interval","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_reconstruction_20260805/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_reconstruction_20260805/build_summary.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":"f923592f03a7775c"}},{"code_sha256_prefix":"9c5aac99837c1eb5","entry":"e2m1_reconstruct","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/p_format_range_diagnostic.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/p_format_range_diagnostic.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":"9c5aac99837c1eb5"}},{"code_sha256_prefix":"9d9fed19126fd7f0","entry":"exact_int","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.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":"9d9fed19126fd7f0"}},{"code_sha256_prefix":"71f764ba6e3d09ee","entry":"find_one","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_b300_tuning_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_b300_tuning_20260802/build_summary.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":"71f764ba6e3d09ee"}},{"code_sha256_prefix":"2244ed035e0955b3","entry":"finite_float","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.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":"2244ed035e0955b3"}},{"code_sha256_prefix":"aa08fe3e1e9a2956","entry":"format_tex_rows","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_b300_tuning_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_b300_tuning_20260802/build_summary.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":"aa08fe3e1e9a2956"}},{"code_sha256_prefix":"f50de98ba6a7a99b","entry":"load_cases","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/build_summary.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":"f50de98ba6a7a99b"}},{"code_sha256_prefix":"cf9fc9656dfc42dd","entry":"load_json","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_b300_tuning_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_b300_tuning_20260802/build_summary.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":"cf9fc9656dfc42dd"}},{"code_sha256_prefix":"0b361f751c283db0","entry":"load_source_map","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_b4_complete.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":"0b361f751c283db0"}},{"code_sha256_prefix":"477d56f3de6777ff","entry":"load_source_map","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_training_curves.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_training_curves.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":"477d56f3de6777ff"}},{"code_sha256_prefix":"826414b6b6eddf48","entry":"load_variant","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_hao_table_gb200_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_hao_table_gb200_20260802/build_summary.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":"826414b6b6eddf48"}},{"code_sha256_prefix":"27e09174cf215156","entry":"mean_layer_metric","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_reconstruction_20260805/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_reconstruction_20260805/build_summary.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":"27e09174cf215156"}},{"code_sha256_prefix":"e5b3157e0edbda66","entry":"metric","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/build_summary.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":"e5b3157e0edbda66"}},{"code_sha256_prefix":"a5706b1f7b9e38c6","entry":"metrics","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_hao_table_gb200_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_hao_table_gb200_20260802/build_summary.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":"a5706b1f7b9e38c6"}},{"code_sha256_prefix":"9bd15075d9712845","entry":"normalize_rows","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/p_format_range_diagnostic.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/p_format_range_diagnostic.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":"9bd15075d9712845"}},{"code_sha256_prefix":"b16f62f94f0cc6fe","entry":"nv_reconstruct","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_unified_20260801/p_format_range_diagnostic.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_unified_20260801/p_format_range_diagnostic.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":"b16f62f94f0cc6fe"}},{"code_sha256_prefix":"5284c9d8206ffe40","entry":"percentile","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/export_llama8b_b4_snapshot.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":"5284c9d8206ffe40"}},{"code_sha256_prefix":"49921aed5fa99f96","entry":"shape_key","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_hao_table_gb200_20260802/build_summary.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_hao_table_gb200_20260802/build_summary.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":"49921aed5fa99f96"}},{"code_sha256_prefix":"eae4c288e4388d94","entry":"update_ewm","repo":"MrHuff/fp4-fa4","repo_kind":"found_in_text","path":"results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_training_curves.py","file_url":"https://github.com/MrHuff/fp4-fa4/blob/HEAD/results/fp4_fa4_technical_report_v2_20260819/fetch_llama8b_training_curves.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":"eae4c288e4388d94"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_daily_20260904.json"},"syntology_extracted_results":null}