{"record":{"id":"9e76206ff406bcbe","repo":"tracel-ai/burn","slug":"input-must-be-concrete","errorCode":null,"errorMessage":"Input must be concrete","messagePattern":"Input must be concrete","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl-fusion/src/optim/matmul/args.rs","lineNumber":253,"sourceCode":"    ) {\n    }\n}\n\n#[cube]\n#[allow(clippy::missing_transmute_annotations)]\nfn global_view<E: CubePrimitive>(\n    inputs: &GlobalArgs,\n    locals: &LocalArgs,\n    batch_shape: &Sequence<FastDivmod<u32>>,\n    #[comptime] arg: MatmulArg,\n    #[comptime] config: FuseBlockConfig,\n    #[comptime] layout_config: GlobalLayoutConfig,\n) -> View<'static, E, BatchedCoords> {\n    let rank = comptime![config.rank];\n    let data = comptime![arg.data().clone()];\n    let data_tensor = match comptime![data.clone()] {\n        FuseArg::Input(pos, ..) => inputs.tensors.index(pos),\n        _ => panic!(\"Input must be concrete\"),\n    };\n\n    let mut shape_row = data_tensor.tensor.shape(rank - 2) as u32;\n    let mut shape_col = data_tensor.tensor.shape(rank - 1) as u32;\n    let mut packing = comptime![1];\n\n    if arg.scheme().is_some() {\n        let scheme = arg.scheme().unwrap();\n        let num_quants = scheme.num_quants() as u32;\n        comptime![packing = num_quants];\n        match comptime![layout_config.matrix_layout] {\n            MatrixLayout::RowMajor => shape_col *= num_quants,\n            MatrixLayout::ColMajor => shape_row *= num_quants,\n        };\n    }\n\n    let shape = (shape_row, shape_col);\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl-fusion/src/optim/matmul/args.rs#L235-L271","documentation":"In the fused matmul's `global_view`, the tensor argument (`FuseArg`) must be a concrete `FuseArg::Input`; the kernel builds a `View` by indexing `inputs.tensors` by position, which only works for actual input tensors. Any other FuseArg variant (output, constant, etc.) cannot be viewed.","triggerScenarios":"Launching the fused matmul kernel with a matmul arg (lhs/rhs/acc) whose data is not `FuseArg::Input` — e.g. an output tensor or virtual arg passed where a concrete input is required.","commonSituations":"Writing custom fused matmul optimizations that wire an output as an operand; fusion graph construction bugs inside burn-cubecl-fusion.","solutions":["Ensure all matmul operand args (lhs, rhs, acc) resolve to FuseArg::Input","If you need an intermediate result as an operand, materialize it as a proper input tensor in the fusion graph","Report a reproducible case to burn maintainers if triggered by standard APIs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert!(matches!(arg.data(), FuseArg::Input(..)), \"matmul operand must be a fusion input tensor\");","typeGuard":"fn is_input_arg(a: &FuseArg) -> bool { matches!(a, FuseArg::Input(..)) }","tryCatchPattern":null,"preventionTips":["Wire matmul operands exclusively from registered fusion inputs","Materialize intermediates as inputs before using them as operands","Validate fusion graph construction in unit tests"],"tags":["fusion","matmul","gpu","internal-invariant"],"backgroundTag":"invalid-fusion-ref-layout","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}