{
    "templates": {
        "BatchedGemmFp4LowLatency": {
            "dtypeA": "e2m1",
            "dtypeC": "e2m1",
            "mmaM": 128,
            "mmaN": 8,
            "mmaK": 64,
            "tileM": 128,
            "tileN": 8,
            "tileK": 512,
            "epilogueTileM": 128,
            "epilogueTileN": 8,
            "numStages": 4,
            "numStagesMma": 1,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": true,
            "useDeepSeekFp8": false,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "sfLayoutB": "8x4",
            "sfLayoutC": "8x4",
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "clampLimit": 2
        },
        "BatchedGemmPerTensorScalingFp8LowLatency": {
            "dtypeA": "e4m3",
            "dtypeC": "e4m3",
            "mmaM": 128,
            "mmaN": 8,
            "mmaK": 32,
            "tileM": 128,
            "tileN": 8,
            "tileK": 512,
            "epilogueTileM": 128,
            "epilogueTileN": 8,
            "numStages": 3,
            "numStagesMma": 1,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": true,
            "useDeepSeekFp8": false,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "clampLimit": 2
        },
        "BatchedGemmDeepSeekFp8LowLatency": {
            "dtypeA": "e4m3",
            "dtypeC": "e4m3",
            "mmaM": 64,
            "mmaN": 8,
            "mmaK": 32,
            "tileM": 128,
            "tileN": 8,
            "tileK": 128,
            "epilogueTileM": 64,
            "epilogueTileN": 8,
            "numStages": 3,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": false,
            "useDeepSeekFp8": true,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "numStagesMmaWithinWorkTile": 2,
            "gridTriggerSecondaryA": false,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "hoistMmaTaskTryWaits": true,
            "numStagesMma": 4,
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "clampLimit": 2
        },
        "BatchedGemmMxE2m1E4m3LowLatency": {
            "dtypeA": "mxe2m1",
            "dtypeB": "e4m3",
            "dtypeC": "e4m3",
            "dtypeMmaB": "mxe4m3",
            "mmaM": 128,
            "mmaN": 8,
            "mmaK": 32,
            "tileM": 128,
            "tileN": 8,
            "tileK": 512,
            "epilogueTileM": 128,
            "epilogueTileN": 8,
            "numStages": 3,
            "numStagesMma": 1,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": true,
            "useDeepSeekFp8": false,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "sfLayoutB": "8x4",
            "sfLayoutC": "8x4",
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "biasType": "m",
            "act": "swiglu",
            "clampLimit": 2
        },
        "BatchedGemmMxE2m1MxE4m3LowLatency": {
            "dtypeA": "mxe2m1",
            "dtypeB": "mxe4m3",
            "dtypeC": "mxe4m3",
            "mmaM": 128,
            "mmaN": 8,
            "mmaK": 32,
            "tileM": 128,
            "tileN": 8,
            "tileK": 512,
            "epilogueTileM": 128,
            "epilogueTileN": 8,
            "numStages": 3,
            "numStagesMma": 1,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": true,
            "useDeepSeekFp8": false,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "sfLayoutB": "8x4",
            "sfLayoutC": "8x4",
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "biasType": "m",
            "act": "swiglu",
            "clampLimit": 2
        },
        "BatchedGemmMxE2m1Bf16LowLatency": {
            "dtypeA": "mxe2m1",
            "dtypeB": "bf16",
            "dtypeC": "bf16",
            "dtypeMmaA": "bf16",
            "dtypeMmaB": "bf16",
            "mmaM": 128,
            "mmaN": 8,
            "mmaK": 16,
            "tileM": 128,
            "tileN": 8,
            "tileK": 256,
            "epilogueTileM": 128,
            "epilogueTileN": 8,
            "numStages": 3,
            "numStagesMma": 1,
            "numSlicesForSplitK": 1,
            "useTwoTmaLoadWarps": true,
            "clusterDimX": 1,
            "clusterDimY": 1,
            "clusterDimZ": 1,
            "sliceK": false,
            "transposeMmaOutput": true,
            "useShuffledMatrixA": true,
            "useDeepSeekFp8": false,
            "useTmaStore": true,
            "useCustomMmaSchedule": true,
            "gridTriggerSecondaryB": true,
            "gridWaitForPrimaryA": false,
            "gridWaitForPrimaryB": true,
            "sfLayoutB": "8x4",
            "sfLayoutC": "8x4",
            "batch": "N",
            "numExperts": 128,
            "useCudaGraph": true,
            "biasType": "m",
            "act": "swiglu",
            "patchF2fp": true,
            "clampLimit": 2
        }
    },
    "configs": [
        {
            "_template": "BatchedGemmFp4LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": ["bf16", "fp16", "e2m1"],
            "listN": "8,8",
            "numExperts": 2,
            "numStagesMma": 1,
            "tileScheduler": "static"
        },
        {
            "_template": "BatchedGemmPerTensorScalingFp8LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": ["bf16", "fp16", "e4m3"],
            "listN": "8,8",
            "numExperts": 2,
            "numStagesMma": 1,
            "tileScheduler": "static"
        },
        {
            "_template": "BatchedGemmDeepSeekFp8LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": ["bf16", "fp16", "e4m3"],
            "listN": "8,8",
            "numExperts": 2,
            "numStagesMma": 2,
            "tileScheduler": "static"
        },
        {
            "_comment": "FP4_FC1",
            "_template": "BatchedGemmFp4LowLatency",
            "routeAct": true,
            "fusedAct": true,
            "sfLayoutB": "linear",
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "e2m1",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,tileK,numStages": [
                [8, 8, 8, 512, 4],
                [16, 16, 16, 512, 4],
                [32, 32, 32, 512, 4],
                [64, 64, 64, 256, 6]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "FP4_FC2",
            "_template": "BatchedGemmFp4LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "tileN,epilogueTileN,mmaN,tileK,numStages": [
                [8, 8, 8, 512, 4],
                [16, 16, 16, 512, 4],
                [32, 32, 32, 512, 4],
                [64, 64, 64, 512, 3],
                [8, 8, 8, 256, 6],
                [16, 16, 16, 256, 6],
                [32, 32, 32, 256, 6],
                [64, 64, 64, 256, 6]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "DS_FP8_FC1",
            "_template": "BatchedGemmDeepSeekFp8LowLatency",
            "routeAct": true,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "e4m3",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,numStages": [
                [8, 8, 8, 8],
                [16, 16, 16, 6],
                [32, 32, 32, 4],
                [64, 64, 64, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 2],
                ["persistent", 4]
            ]
        },
        {
            "_comment": "DS_FP8_FC2",
            "_template": "BatchedGemmDeepSeekFp8LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,numStages": [
                [8, 8, 8, 8],
                [16, 16, 16, 6],
                [32, 32, 32, 4],
                [64, 64, 64, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 2],
                ["persistent", 4]
            ]
        },
        {
            "_comment": "Llama4_FP8_FC1",
            "_template": "BatchedGemmPerTensorScalingFp8LowLatency",
            "routeAct": true,
            "fusedAct": true,
            "usePerTokenSfB": true,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "e4m3",
            "numTokens": 2,
            "numExperts": 2,
            "numStages": 3,
            "numStagesMma": 1,
            "tileScheduler": "static"
        },
        {
            "_comment": "Llama4_FP8_FC2",
            "_template": "BatchedGemmPerTensorScalingFp8LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "numStages": 3,
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xFp8_FC1",
            "_template": "BatchedGemmMxE2m1E4m3LowLatency",
            "routeAct": "ldgsts",
            "fusedAct": true,
            "sfLayoutB": "linear",
            "useUnrollLoop2xForMma": [true, false],
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,tileK,numStages": [
                [8, 8, 8, 512, 3],
                [8, 8, 8, 256, 5],
                [16, 16, 16, 256, 5],
                [32, 32, 32, 256, 5],
                [64, 64, 64, 256, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xFp8_FC2",
            "_template": "BatchedGemmMxE2m1E4m3LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,tileK,numStages": [
                [8, 8, 8, 512, 3],
                [8, 8, 8, 256, 5],
                [16, 16, 16, 256, 5],
                [32, 32, 32, 256, 5],
                [64, 64, 64, 256, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xMxFp8_FC1",
            "_template": "BatchedGemmMxE2m1MxE4m3LowLatency",
            "routeAct": "ldgsts",
            "fusedAct": true,
            "sfLayoutB": "linear",
            "useUnrollLoop2xForMma": [true, false],
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,tileK,numSlicesForSplitK,clusterDimZ,numStages": [
                [8, 8, 8, 512, 1, 1, 3],
                [8, 8, 8, 512, 2, 2, 3],
                [8, 8, 8, 256, 1, 1, 4],
                [8, 8, 8, 256, 1, 1, 5],
                [8, 8, 8, 256, 1, 1, 6],
                [8, 8, 8, 256, 2, 2, 4],
                [8, 8, 8, 256, 2, 2, 5],
                [8, 8, 8, 256, 2, 2, 6],
                [16, 16, 16, 256, 1, 1, 3],
                [16, 16, 16, 256, 1, 1, 4],
                [32, 32, 32, 256, 1, 1, 3],
                [32, 32, 32, 256, 1, 1, 4],
                [64, 64, 64, 256, 1, 1, 3],
                [64, 64, 64, 256, 1, 1, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xMxFp8_FC2",
            "_template": "BatchedGemmMxE2m1MxE4m3LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,tileK,numSlicesForSplitK,clusterDimZ,numStages": [
                [8, 8, 8, 512, 1, 1, 3],
                [8, 8, 8, 512, 2, 2, 3],
                [8, 8, 8, 256, 1, 1, 4],
                [8, 8, 8, 256, 1, 1, 5],
                [8, 8, 8, 256, 1, 1, 6],
                [8, 8, 8, 256, 2, 2, 4],
                [8, 8, 8, 256, 2, 2, 5],
                [8, 8, 8, 256, 2, 2, 6],
                [16, 16, 16, 256, 1, 1, 3],
                [16, 16, 16, 256, 1, 1, 4],
                [32, 32, 32, 256, 1, 1, 3],
                [32, 32, 32, 256, 1, 1, 4],
                [64, 64, 64, 256, 1, 1, 3],
                [64, 64, 64, 256, 1, 1, 4]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xBf16_FC1",
            "_template": "BatchedGemmMxE2m1Bf16LowLatency",
            "routeAct": "ldgsts",
            "fusedAct": true,
            "sfLayoutB": "linear",
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "tileK": 256,
            "mmaN,tileN,epilogueTileN,numStages": [
                [8, 8, 8, 3],
                [16, 16, 16, 3],
                [32, 32, 32, 3],
                [64, 64, 64, 3]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        },
        {
            "_comment": "MxFp4xBf16_FC2",
            "_template": "BatchedGemmMxE2m1Bf16LowLatency",
            "routeAct": false,
            "fusedAct": false,
            "useUnrollLoop2xForMma": [true, false],
            "dtypeC": "bf16",
            "numTokens": 2,
            "numExperts": 2,
            "mmaN,tileN,epilogueTileN,numStages": [
                [8, 8, 8, 3],
                [16, 16, 16, 3],
                [32, 32, 32, 3],
                [64, 64, 64, 3]
            ],
            "tileScheduler,numStagesMma": [
                ["static", 1],
                ["persistent", 2]
            ]
        }
    ]
}
