Uploaded using `kernel-builder`.
Browse filesFiles changed (38)
- benchmarks/benchmark.py+4-1
- benchmarks/benchmark_mlp_v2.pyAdded+151
- build/torch211-cxx11-cu128-x86_64-linux/__init__.py+158
- build/torch211-cxx11-cu128-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.so → build/torch211-cxx11-cu128-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soRenamed+2-2
- build/torch211-cxx11-cu128-x86_64-linux/_ops.py+3-3
- build/torch211-cxx11-cu128-x86_64-linux/metadata.json+1-1
- build/torch211-cxx11-cu130-x86_64-linux/__init__.py+158
- build/torch211-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.so → build/torch211-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soRenamed+2-2
- build/torch211-cxx11-cu130-x86_64-linux/_ops.py+3-3
- build/torch211-cxx11-cu130-x86_64-linux/metadata.json+1-1
- build/torch211-cxx11-rocm71-x86_64-linux/__init__.py+158
- build/torch211-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.so → build/torch211-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soRenamed+2-2
- build/torch211-cxx11-rocm71-x86_64-linux/_ops.py+3-3
- build/torch211-cxx11-rocm71-x86_64-linux/metadata.json+1-1
- build/torch211-cxx11-rocm72-x86_64-linux/__init__.py+158
- build/torch211-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.so → build/torch211-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soRenamed+2-2
- build/torch211-cxx11-rocm72-x86_64-linux/_ops.py+3-3
- build/torch211-cxx11-rocm72-x86_64-linux/metadata.json+1-1
- build/torch212-cxx11-cu130-x86_64-linux/__init__.py+158
- build/torch212-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.soDeleted-3
- build/torch212-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soAdded+3
- build/torch212-cxx11-cu130-x86_64-linux/_ops.py+3-3
- build/torch212-cxx11-cu130-x86_64-linux/metadata.json+1-1
- build/torch212-cxx11-cu132-x86_64-linux/__init__.py+158
- build/torch212-cxx11-cu132-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.soDeleted-3
- build/torch212-cxx11-cu132-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soAdded+3
- build/torch212-cxx11-cu132-x86_64-linux/_ops.py+3-3
- build/torch212-cxx11-cu132-x86_64-linux/metadata.json+1-1
- build/torch212-cxx11-rocm71-x86_64-linux/__init__.py+158
- build/torch212-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.soDeleted-3
- build/torch212-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soAdded+3
- build/torch212-cxx11-rocm71-x86_64-linux/_ops.py+3-3
- build/torch212-cxx11-rocm71-x86_64-linux/metadata.json+1-1
- build/torch212-cxx11-rocm72-x86_64-linux/__init__.py+158
- build/torch212-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.soDeleted-3
- build/torch212-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soAdded+3
- build/torch212-cxx11-rocm72-x86_64-linux/_ops.py+3-3
- build/torch212-cxx11-rocm72-x86_64-linux/metadata.json+1-1
253 unmodified lines254255256257258259260253 unmodified linesdef load_hub_ops(repo_id: str, version: int):from kernels import get_kernelreturn get_kernel(repo_id, version=version)def fp8_dtype() -> torch.dtype:253 unmodified lines254255256257258259260261262263253 unmodified linesdef load_hub_ops(repo_id: str, version: int):from kernels import get_kerneltry:return get_kernel(repo_id, version=version, trust_remote_code=True)except TypeError:return get_kernel(repo_id, version=version)def fp8_dtype() -> torch.dtype:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151#!/usr/bin/env python3"""Compare staged-bias v1 and fused-bias v2 FP8 GELU MLP entries."""
from __future__ import annotations
import argparseimport importlibimport importlib.utilimport jsonimport osimport statisticsimport sysfrom pathlib import Path
import torch
ROOT = Path(__file__).resolve().parents[2]TEST_FILE = ROOT / "flashrt-fp8-ffn" / "tests" / "test_fp8_ffn.py"SHAPES = { "groot_vit": (128, 1024, 4096, 1024), "groot_deepstack": (128, 4096, 4096, 2048), "groot_action_dit": (41, 1536, 6144, 1536), "pi05_decoder": (10, 1024, 4096, 1024),}
def helpers_module(): spec = importlib.util.spec_from_file_location("fp8_ffn_helpers", TEST_FILE) if spec is None or spec.loader is None: raise RuntimeError(f"cannot load {TEST_FILE}") module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module
def time_us(fn, warmup: int, iterations: int, rounds: int = 5) -> float: samples = [] for _ in range(rounds): for _ in range(warmup): fn() torch.cuda.synchronize() start = torch.cuda.Event(enable_timing=True) end = torch.cuda.Event(enable_timing=True) start.record() for _ in range(iterations): fn() end.record() end.synchronize() samples.append(start.elapsed_time(end) * 1000.0 / iterations) return float(statistics.median(samples))
def main() -> int: parser = argparse.ArgumentParser() parser.add_argument("--backend", choices=("source", "installed"), default="source") parser.add_argument("--artifact") parser.add_argument("--warmup", type=int, default=20) parser.add_argument("--iterations", type=int, default=100) parser.add_argument("--json-out") args = parser.parse_args() helpers = helpers_module() if args.backend == "source": ops = helpers.load_source_ops() else: if args.artifact: sys.path.insert(0, args.artifact) try: ops = importlib.import_module("flashrt_fp8_ffn") finally: if args.artifact: sys.path.remove(args.artifact)
rows = [] for name, shape in SHAPES.items(): tensors = helpers.make_case(*shape) m, _, h, n = shape hidden_v1 = torch.empty((m, h), device="cuda", dtype=torch.bfloat16) hidden_fp8_v1 = torch.empty_like(hidden_v1, dtype=helpers.fp8_dtype()) out_v1_buf = torch.empty((m, n), device="cuda", dtype=torch.bfloat16) hidden_v2 = torch.empty_like(hidden_v1) hidden_fp8_v2 = torch.empty_like(hidden_fp8_v1) out_v2_buf = torch.empty_like(out_v1_buf) if args.backend == "source": v1 = lambda: ops.fp8_gelu_mlp_bf16( *tensors, hidden=hidden_v1, hidden_fp8=hidden_fp8_v1, out=out_v1_buf, ) v2 = lambda: ops.fp8_gelu_mlp_v2_bf16( *tensors, hidden=hidden_v2, hidden_fp8=hidden_fp8_v2, out=out_v2_buf, ) else: v1 = lambda: ops.fp8_gelu_mlp_bf16( *tensors, hidden_bf16=hidden_v1, hidden_fp8=hidden_fp8_v1, out=out_v1_buf, ) v2 = lambda: ops.fp8_gelu_mlp_v2_bf16( *tensors, hidden_bf16=hidden_v2, hidden_fp8=hidden_fp8_v2, out=out_v2_buf, ) out_v1 = v1() out_v2 = v2() torch.cuda.synchronize() old = os.environ.get("FLASHRT_FP8_FFN_REQUIRE_BIAS_EPILOGUE") os.environ["FLASHRT_FP8_FFN_REQUIRE_BIAS_EPILOGUE"] = "1" try: v2() torch.cuda.synchronize() fused_hit = True except RuntimeError as error: if "BIAS epilogue was required" not in str(error): raise fused_hit = False finally: if old is None: os.environ.pop("FLASHRT_FP8_FFN_REQUIRE_BIAS_EPILOGUE", None) else: os.environ["FLASHRT_FP8_FFN_REQUIRE_BIAS_EPILOGUE"] = old metrics = helpers.distribution_metrics(out_v2, out_v1) v1_us = time_us(v1, args.warmup, args.iterations) v2_us = time_us(v2, args.warmup, args.iterations) row = { "shape": name, "M": shape[0], "K": shape[1], "H": shape[2], "N": shape[3], "fused_bias_epilogue": fused_hit, "v1_us": v1_us, "v2_us": v2_us, "speedup": v1_us / v2_us, **metrics, } rows.append(row) print(json.dumps(row, sort_keys=True), flush=True)
result = { "device": torch.cuda.get_device_name(), "capability": list(torch.cuda.get_device_capability()), "torch": torch.__version__, "cuda": torch.version.cuda, "rows": rows, } if args.json_out: Path(args.json_out).write_text(json.dumps(result, indent=2) + "\n") return 0
if __name__ == "__main__": raise SystemExit(main())144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:3d274681fba749480e852c3da2670c29041914b6edfb234ebce6e46bec1afa8csize 698640123version https://git-lfs.github.com/spec/v1oid sha256:46aff28a95fa0aa348046c6845ed289baa67c10c39c1b9936afcab4a709f3d07size 703520
123456789import torchfrom . import _flashrt_fp8_ffn_cuda_255584fops = torch.ops._flashrt_fp8_ffn_cuda_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_cuda_b2eeca0ops = torch.ops._flashrt_fp8_ffn_cuda_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:2636112b16bd21bec7d249cf99d86206b873df2f8672fe47a560e57171b55cd2size 668320123version https://git-lfs.github.com/spec/v1oid sha256:1f6a225f67637c94184bc64dfb3c93c23a0e5e0f3e7957ba20a1a01874d21f5fsize 673200
123456789import torchfrom . import _flashrt_fp8_ffn_cuda_255584fops = torch.ops._flashrt_fp8_ffn_cuda_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_cuda_b2eeca0ops = torch.ops._flashrt_fp8_ffn_cuda_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:b0a6f1d91521ad7db13bb2f702ce4e74c4f54aa5e3666c6a11c52bd4ecc1c31dsize 180528123version https://git-lfs.github.com/spec/v1oid sha256:409804cf1498f2d98af1c3cf5ba70dd4d3e8a8c6e1ab8725668371d329797711size 187352
123456789import torchfrom . import _flashrt_fp8_ffn_rocm_255584fops = torch.ops._flashrt_fp8_ffn_rocm_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_rocm_b2eeca0ops = torch.ops._flashrt_fp8_ffn_rocm_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:01f36636ddf259f85c94157b09cb5267b9cd4b371b148acd5150f4f3c13f3b78size 178992123version https://git-lfs.github.com/spec/v1oid sha256:c6f65669c49255f4bce57e5bcd24f0298fe67147bdf0f495ea827d83fb4e9eafsize 185816
123456789import torchfrom . import _flashrt_fp8_ffn_rocm_255584fops = torch.ops._flashrt_fp8_ffn_rocm_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_rocm_b2eeca0ops = torch.ops._flashrt_fp8_ffn_rocm_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:9cf974f0a6585860d33d00d4269205d2046cbaa8e74442d4e289ec8ea7cddc6esize 668544123version https://git-lfs.github.com/spec/v1oid sha256:0a95a3b6e1f95822e181bd4a01f425ef5fbe8dcadcabe684f59bd33c76987ed9size 673144123456789import torchfrom . import _flashrt_fp8_ffn_cuda_255584fops = torch.ops._flashrt_fp8_ffn_cuda_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_cuda_b2eeca0ops = torch.ops._flashrt_fp8_ffn_cuda_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:92f9e9ba898c08f78f8ea086de134a0f1dcfb1201ce9d04ca932d4ed30844919size 668544123version https://git-lfs.github.com/spec/v1oid sha256:81094023a0b91b9bd217f3bce768851bcf0923776bb17b6e8d2f192bd20ef063size 673144123456789import torchfrom . import _flashrt_fp8_ffn_cuda_255584fops = torch.ops._flashrt_fp8_ffn_cuda_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_cuda_b2eeca0ops = torch.ops._flashrt_fp8_ffn_cuda_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_cuda_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_cuda_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:6203acdac17af6b44944b57bb831a4584a39b8ad401f0e8cd58a7c2b5760862esize 180000123version https://git-lfs.github.com/spec/v1oid sha256:8dc1bfc079ae1d9ee4a6f535ad36ee88fcc380f6b59ec075fab1116e49ef8b0asize 187584123456789import torchfrom . import _flashrt_fp8_ffn_rocm_255584fops = torch.ops._flashrt_fp8_ffn_rocm_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_rocm_b2eeca0ops = torch.ops._flashrt_fp8_ffn_rocm_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
144 unmodified lines14514614714814915022 unmodified lines173174175176177178254 unmodified lines433434435436437438439440441442443144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn Nonedef _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]144 unmodified lines14514614714814915015115215315415515615715815916016116216316416516616716816917017122 unmodified lines194195196197198199200201202203204205206207208209210211212213214215216217218219220221222254 unmodified lines477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601144 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_v2_bf16"))def _fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, hidden_bf16,hidden_fp8, out)@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_bf16"))def _bf16_fp8_gelu_mlp_bf16_fake(input: torch.Tensor,22 unmodified linesreturn None@torch.library.register_fake(add_op_namespace_prefix("bf16_fp8_gelu_mlp_v2_bf16"))def _bf16_fp8_gelu_mlp_v2_bf16_fake(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor,hidden_bf16: torch.Tensor,hidden_fp8: torch.Tensor,out: torch.Tensor,) -> None:return _bf16_fp8_gelu_mlp_bf16_fake(input, up_weight, up_bias, down_weight, down_bias, input_scale,up_weight_scale, hidden_scale, down_weight_scale, input_fp8,hidden_bf16, hidden_fp8, out)def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:return torch.tensor([value], device=input.device, dtype=torch.float32)254 unmodified linesreturn out[:logical_m]def fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,) -> torch.Tensor:"""``fp8_gelu_mlp_bf16`` with the down bias in the GEMM epilogue.Same contract and buffers as the v1 entry; one launch and one fullwrite of ``out`` less per call on targets whose cublasLt pathaccepts the BIAS epilogue (elsewhere the runtime falls back to thev1 two-launch tail, still correct)."""if hidden_bf16 is None:hidden_bf16 = torch.empty((input.shape[0], up_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((input.shape[0], down_weight.shape[0]),device=input.device,dtype=torch.bfloat16,)ops.fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,hidden_bf16,hidden_fp8,out,)return outdef bf16_fp8_gelu_mlp_v2_bf16(input: torch.Tensor,up_weight: torch.Tensor,up_bias: torch.Tensor,down_weight: torch.Tensor,down_bias: torch.Tensor,input_scale: torch.Tensor,up_weight_scale: torch.Tensor,hidden_scale: torch.Tensor,down_weight_scale: torch.Tensor,input_fp8: torch.Tensor | None = None,hidden_bf16: torch.Tensor | None = None,hidden_fp8: torch.Tensor | None = None,out: torch.Tensor | None = None,*,pad_to: int | None = None,) -> torch.Tensor:"""``bf16_fp8_gelu_mlp_bf16`` with the down bias in the epilogue.Identical padding and buffer contract to the v1 entry."""logical_m = input.shape[0]padded_m = _midm_padded_rows(input) if pad_to is None else pad_toif padded_m < logical_m:raise ValueError("pad_to must be >= input.shape[0]")device = input.deviceif input_fp8 is None:input_fp8 = torch.empty((padded_m, input.shape[1]), device=device, dtype=_fp8_dtype())if hidden_bf16 is None:hidden_bf16 = torch.empty((padded_m, up_weight.shape[0]), device=device, dtype=torch.bfloat16)if hidden_fp8 is None:hidden_fp8 = torch.empty_like(hidden_bf16, dtype=_fp8_dtype())if out is None:out = torch.empty((padded_m, down_weight.shape[0]), device=device, dtype=torch.bfloat16)ops.bf16_fp8_gelu_mlp_v2_bf16(input,up_weight,up_bias,down_weight,down_bias,input_scale,up_weight_scale,hidden_scale,down_weight_scale,input_fp8,hidden_bf16,hidden_fp8,out,)return out[:logical_m]__all__ = ["bf16_fp8_linear_bias_bf16","bf16_fp8_gelu_mlp_bf16","bf16_fp8_gelu_mlp_v2_bf16","fp8_gemm_bf16","fp8_gelu_mlp_bf16","fp8_gelu_mlp_v2_bf16","fp8_linear_bias_bf16","fp8_linear_bias_gelu_quant_bf16",]
123version https://git-lfs.github.com/spec/v1oid sha256:eb09062fde7313db39fe558ff36f8b902b04ac06fade78310ccd1eb27ad3d90bsize 178424123version https://git-lfs.github.com/spec/v1oid sha256:860c6f79cb15466319a99fc5df4f1651d1040a8d074d9df37ecdf8f86b1985b7size 186040123456789import torchfrom . import _flashrt_fp8_ffn_rocm_255584fops = torch.ops._flashrt_fp8_ffn_rocm_255584fdef add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_255584f::{op_name}"123456789import torchfrom . import _flashrt_fp8_ffn_rocm_b2eeca0ops = torch.ops._flashrt_fp8_ffn_rocm_b2eeca0def add_op_namespace_prefix(op_name: str):"""Prefix op by namespace."""return f"_flashrt_fp8_ffn_rocm_b2eeca0::{op_name}"
123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_255584f","version": 1,"license": "Apache-2.0","python-depends": [],123456{"name": "flashrt-fp8-ffn","id": "_flashrt_fp8_ffn_rocm_b2eeca0","version": 1,"license": "Apache-2.0","python-depends": [],
benchmarks/benchmark.py+4-1
benchmarks/benchmark_mlp_v2.pyAdded+151
build/torch211-cxx11-cu128-x86_64-linux/__init__.py+158
build/torch211-cxx11-cu128-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.so → build/torch211-cxx11-cu128-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soRenamed+2-2
build/torch211-cxx11-cu128-x86_64-linux/_ops.py+3-3
build/torch211-cxx11-cu128-x86_64-linux/metadata.json+1-1
build/torch211-cxx11-cu130-x86_64-linux/__init__.py+158
build/torch211-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.so → build/torch211-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soRenamed+2-2
build/torch211-cxx11-cu130-x86_64-linux/_ops.py+3-3
build/torch211-cxx11-cu130-x86_64-linux/metadata.json+1-1
build/torch211-cxx11-rocm71-x86_64-linux/__init__.py+158
build/torch211-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.so → build/torch211-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soRenamed+2-2
build/torch211-cxx11-rocm71-x86_64-linux/_ops.py+3-3
build/torch211-cxx11-rocm71-x86_64-linux/metadata.json+1-1
build/torch211-cxx11-rocm72-x86_64-linux/__init__.py+158
build/torch211-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.so → build/torch211-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soRenamed+2-2
build/torch211-cxx11-rocm72-x86_64-linux/_ops.py+3-3
build/torch211-cxx11-rocm72-x86_64-linux/metadata.json+1-1
build/torch212-cxx11-cu130-x86_64-linux/__init__.py+158
build/torch212-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.soDeleted-3
build/torch212-cxx11-cu130-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soAdded+3
build/torch212-cxx11-cu130-x86_64-linux/_ops.py+3-3
build/torch212-cxx11-cu130-x86_64-linux/metadata.json+1-1
build/torch212-cxx11-cu132-x86_64-linux/__init__.py+158
build/torch212-cxx11-cu132-x86_64-linux/_flashrt_fp8_ffn_cuda_255584f.abi3.soDeleted-3
build/torch212-cxx11-cu132-x86_64-linux/_flashrt_fp8_ffn_cuda_b2eeca0.abi3.soAdded+3
build/torch212-cxx11-cu132-x86_64-linux/_ops.py+3-3
build/torch212-cxx11-cu132-x86_64-linux/metadata.json+1-1
build/torch212-cxx11-rocm71-x86_64-linux/__init__.py+158
build/torch212-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.soDeleted-3
build/torch212-cxx11-rocm71-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soAdded+3
build/torch212-cxx11-rocm71-x86_64-linux/_ops.py+3-3
build/torch212-cxx11-rocm71-x86_64-linux/metadata.json+1-1
build/torch212-cxx11-rocm72-x86_64-linux/__init__.py+158
build/torch212-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_255584f.abi3.soDeleted-3
build/torch212-cxx11-rocm72-x86_64-linux/_flashrt_fp8_ffn_rocm_b2eeca0.abi3.soAdded+3
build/torch212-cxx11-rocm72-x86_64-linux/_ops.py+3-3
build/torch212-cxx11-rocm72-x86_64-linux/metadata.json+1-1