liangsu9988 commited on
Commit
8bd9340
·
verified ·
1 Parent(s): 1f0c850

Uploaded using `kernel-builder`.

Browse files
build/torch211-cxx11-cu128-x86_64-linux/__init__.py CHANGED
@@ -31,7 +31,68 @@ def _preload_cublaslt() -> None:
31
 
32
  _preload_cublaslt()
33
 
34
- from ._ops import ops
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
 
31
 
32
  _preload_cublaslt()
33
 
34
+ from ._ops import add_op_namespace_prefix, ops
35
+
36
+
37
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gemm_bf16"))
38
+ def _fp8_gemm_bf16_fake(
39
+ input: torch.Tensor,
40
+ weight: torch.Tensor,
41
+ input_scale: torch.Tensor,
42
+ weight_scale: torch.Tensor,
43
+ out: torch.Tensor,
44
+ ) -> None:
45
+ if input.dim() != 2 or weight.dim() != 2:
46
+ raise RuntimeError("input and weight must be rank-2 tensors")
47
+ if out.shape != (input.shape[0], weight.shape[0]):
48
+ raise RuntimeError("out shape must be (input.shape[0], weight.shape[0])")
49
+ return None
50
+
51
+
52
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_linear_bias_gelu_quant_bf16"))
53
+ def _fp8_linear_bias_gelu_quant_bf16_fake(
54
+ input: torch.Tensor,
55
+ weight: torch.Tensor,
56
+ bias: torch.Tensor,
57
+ input_scale: torch.Tensor,
58
+ weight_scale: torch.Tensor,
59
+ output_scale: torch.Tensor,
60
+ hidden_bf16: torch.Tensor,
61
+ out_fp8: torch.Tensor,
62
+ ) -> None:
63
+ expected = (input.shape[0], weight.shape[0])
64
+ if hidden_bf16.shape != expected or out_fp8.shape != expected:
65
+ raise RuntimeError(
66
+ "hidden_bf16 and out_fp8 shapes must be "
67
+ "(input.shape[0], weight.shape[0])"
68
+ )
69
+ return None
70
+
71
+
72
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_bf16"))
73
+ def _fp8_gelu_mlp_bf16_fake(
74
+ input: torch.Tensor,
75
+ up_weight: torch.Tensor,
76
+ up_bias: torch.Tensor,
77
+ down_weight: torch.Tensor,
78
+ down_bias: torch.Tensor,
79
+ input_scale: torch.Tensor,
80
+ up_weight_scale: torch.Tensor,
81
+ hidden_scale: torch.Tensor,
82
+ down_weight_scale: torch.Tensor,
83
+ hidden_bf16: torch.Tensor,
84
+ hidden_fp8: torch.Tensor,
85
+ out: torch.Tensor,
86
+ ) -> None:
87
+ hidden_shape = (input.shape[0], up_weight.shape[0])
88
+ out_shape = (input.shape[0], down_weight.shape[0])
89
+ if hidden_bf16.shape != hidden_shape or hidden_fp8.shape != hidden_shape:
90
+ raise RuntimeError(
91
+ "hidden buffers must be (input.shape[0], up_weight.shape[0])"
92
+ )
93
+ if out.shape != out_shape:
94
+ raise RuntimeError("out shape must be (input.shape[0], down_weight.shape[0])")
95
+ return None
96
 
97
 
98
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
build/torch211-cxx11-cu128-x86_64-linux/{_flashrt_fp8_ffn_cuda_e9a1fe0.abi3.so → _flashrt_fp8_ffn_cuda_c4d802d.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:364b7d5fdecc653760cee17638abf66b65ce755594c3e56618065c079d7fb9c0
3
  size 309744
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bfc90be7bacf4046348951be8440728ede008ac9a5df78da6ba64275fa09ba3d
3
  size 309744
build/torch211-cxx11-cu128-x86_64-linux/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _flashrt_fp8_ffn_cuda_e9a1fe0
3
- ops = torch.ops._flashrt_fp8_ffn_cuda_e9a1fe0
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_flashrt_fp8_ffn_cuda_e9a1fe0::{op_name}"
 
1
  import torch
2
+ from . import _flashrt_fp8_ffn_cuda_c4d802d
3
+ ops = torch.ops._flashrt_fp8_ffn_cuda_c4d802d
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_flashrt_fp8_ffn_cuda_c4d802d::{op_name}"
build/torch211-cxx11-cu128-x86_64-linux/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "flashrt-fp8-ffn",
3
- "id": "_flashrt_fp8_ffn_cuda_e9a1fe0",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "flashrt-fp8-ffn",
3
+ "id": "_flashrt_fp8_ffn_cuda_c4d802d",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch211-cxx11-cu130-x86_64-linux/__init__.py CHANGED
@@ -31,7 +31,68 @@ def _preload_cublaslt() -> None:
31
 
32
  _preload_cublaslt()
33
 
34
- from ._ops import ops
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
 
31
 
32
  _preload_cublaslt()
33
 
34
+ from ._ops import add_op_namespace_prefix, ops
35
+
36
+
37
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gemm_bf16"))
38
+ def _fp8_gemm_bf16_fake(
39
+ input: torch.Tensor,
40
+ weight: torch.Tensor,
41
+ input_scale: torch.Tensor,
42
+ weight_scale: torch.Tensor,
43
+ out: torch.Tensor,
44
+ ) -> None:
45
+ if input.dim() != 2 or weight.dim() != 2:
46
+ raise RuntimeError("input and weight must be rank-2 tensors")
47
+ if out.shape != (input.shape[0], weight.shape[0]):
48
+ raise RuntimeError("out shape must be (input.shape[0], weight.shape[0])")
49
+ return None
50
+
51
+
52
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_linear_bias_gelu_quant_bf16"))
53
+ def _fp8_linear_bias_gelu_quant_bf16_fake(
54
+ input: torch.Tensor,
55
+ weight: torch.Tensor,
56
+ bias: torch.Tensor,
57
+ input_scale: torch.Tensor,
58
+ weight_scale: torch.Tensor,
59
+ output_scale: torch.Tensor,
60
+ hidden_bf16: torch.Tensor,
61
+ out_fp8: torch.Tensor,
62
+ ) -> None:
63
+ expected = (input.shape[0], weight.shape[0])
64
+ if hidden_bf16.shape != expected or out_fp8.shape != expected:
65
+ raise RuntimeError(
66
+ "hidden_bf16 and out_fp8 shapes must be "
67
+ "(input.shape[0], weight.shape[0])"
68
+ )
69
+ return None
70
+
71
+
72
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_bf16"))
73
+ def _fp8_gelu_mlp_bf16_fake(
74
+ input: torch.Tensor,
75
+ up_weight: torch.Tensor,
76
+ up_bias: torch.Tensor,
77
+ down_weight: torch.Tensor,
78
+ down_bias: torch.Tensor,
79
+ input_scale: torch.Tensor,
80
+ up_weight_scale: torch.Tensor,
81
+ hidden_scale: torch.Tensor,
82
+ down_weight_scale: torch.Tensor,
83
+ hidden_bf16: torch.Tensor,
84
+ hidden_fp8: torch.Tensor,
85
+ out: torch.Tensor,
86
+ ) -> None:
87
+ hidden_shape = (input.shape[0], up_weight.shape[0])
88
+ out_shape = (input.shape[0], down_weight.shape[0])
89
+ if hidden_bf16.shape != hidden_shape or hidden_fp8.shape != hidden_shape:
90
+ raise RuntimeError(
91
+ "hidden buffers must be (input.shape[0], up_weight.shape[0])"
92
+ )
93
+ if out.shape != out_shape:
94
+ raise RuntimeError("out shape must be (input.shape[0], down_weight.shape[0])")
95
+ return None
96
 
97
 
98
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
build/torch211-cxx11-cu130-x86_64-linux/{_flashrt_fp8_ffn_cuda_e9a1fe0.abi3.so → _flashrt_fp8_ffn_cuda_c4d802d.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:250d27eccb9e7a5231237783665bcbd67871820aa8f7404282032a4329951877
3
  size 307864
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd3c15cc8814d66a0e05382fa807119863e15a0da11f935041f9f58e96e5091d
3
  size 307864
build/torch211-cxx11-cu130-x86_64-linux/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _flashrt_fp8_ffn_cuda_e9a1fe0
3
- ops = torch.ops._flashrt_fp8_ffn_cuda_e9a1fe0
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_flashrt_fp8_ffn_cuda_e9a1fe0::{op_name}"
 
1
  import torch
2
+ from . import _flashrt_fp8_ffn_cuda_c4d802d
3
+ ops = torch.ops._flashrt_fp8_ffn_cuda_c4d802d
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_flashrt_fp8_ffn_cuda_c4d802d::{op_name}"
build/torch211-cxx11-cu130-x86_64-linux/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "flashrt-fp8-ffn",
3
- "id": "_flashrt_fp8_ffn_cuda_e9a1fe0",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "flashrt-fp8-ffn",
3
+ "id": "_flashrt_fp8_ffn_cuda_c4d802d",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch212-cxx11-cu130-x86_64-linux/__init__.py CHANGED
@@ -31,7 +31,68 @@ def _preload_cublaslt() -> None:
31
 
32
  _preload_cublaslt()
33
 
34
- from ._ops import ops
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
 
31
 
32
  _preload_cublaslt()
33
 
34
+ from ._ops import add_op_namespace_prefix, ops
35
+
36
+
37
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gemm_bf16"))
38
+ def _fp8_gemm_bf16_fake(
39
+ input: torch.Tensor,
40
+ weight: torch.Tensor,
41
+ input_scale: torch.Tensor,
42
+ weight_scale: torch.Tensor,
43
+ out: torch.Tensor,
44
+ ) -> None:
45
+ if input.dim() != 2 or weight.dim() != 2:
46
+ raise RuntimeError("input and weight must be rank-2 tensors")
47
+ if out.shape != (input.shape[0], weight.shape[0]):
48
+ raise RuntimeError("out shape must be (input.shape[0], weight.shape[0])")
49
+ return None
50
+
51
+
52
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_linear_bias_gelu_quant_bf16"))
53
+ def _fp8_linear_bias_gelu_quant_bf16_fake(
54
+ input: torch.Tensor,
55
+ weight: torch.Tensor,
56
+ bias: torch.Tensor,
57
+ input_scale: torch.Tensor,
58
+ weight_scale: torch.Tensor,
59
+ output_scale: torch.Tensor,
60
+ hidden_bf16: torch.Tensor,
61
+ out_fp8: torch.Tensor,
62
+ ) -> None:
63
+ expected = (input.shape[0], weight.shape[0])
64
+ if hidden_bf16.shape != expected or out_fp8.shape != expected:
65
+ raise RuntimeError(
66
+ "hidden_bf16 and out_fp8 shapes must be "
67
+ "(input.shape[0], weight.shape[0])"
68
+ )
69
+ return None
70
+
71
+
72
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_bf16"))
73
+ def _fp8_gelu_mlp_bf16_fake(
74
+ input: torch.Tensor,
75
+ up_weight: torch.Tensor,
76
+ up_bias: torch.Tensor,
77
+ down_weight: torch.Tensor,
78
+ down_bias: torch.Tensor,
79
+ input_scale: torch.Tensor,
80
+ up_weight_scale: torch.Tensor,
81
+ hidden_scale: torch.Tensor,
82
+ down_weight_scale: torch.Tensor,
83
+ hidden_bf16: torch.Tensor,
84
+ hidden_fp8: torch.Tensor,
85
+ out: torch.Tensor,
86
+ ) -> None:
87
+ hidden_shape = (input.shape[0], up_weight.shape[0])
88
+ out_shape = (input.shape[0], down_weight.shape[0])
89
+ if hidden_bf16.shape != hidden_shape or hidden_fp8.shape != hidden_shape:
90
+ raise RuntimeError(
91
+ "hidden buffers must be (input.shape[0], up_weight.shape[0])"
92
+ )
93
+ if out.shape != out_shape:
94
+ raise RuntimeError("out shape must be (input.shape[0], down_weight.shape[0])")
95
+ return None
96
 
97
 
98
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
build/torch212-cxx11-cu130-x86_64-linux/{_flashrt_fp8_ffn_cuda_e9a1fe0.abi3.so → _flashrt_fp8_ffn_cuda_c4d802d.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4bb7793bcc92617d9b7b60d62d78314c368e782632d79e443e0f5fcc2f23b935
3
  size 314112
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1f871097905e3aab25d5cfd6af9c0bc69925b99007af8dbbb9645b818fed9e9
3
  size 314112
build/torch212-cxx11-cu130-x86_64-linux/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _flashrt_fp8_ffn_cuda_e9a1fe0
3
- ops = torch.ops._flashrt_fp8_ffn_cuda_e9a1fe0
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_flashrt_fp8_ffn_cuda_e9a1fe0::{op_name}"
 
1
  import torch
2
+ from . import _flashrt_fp8_ffn_cuda_c4d802d
3
+ ops = torch.ops._flashrt_fp8_ffn_cuda_c4d802d
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_flashrt_fp8_ffn_cuda_c4d802d::{op_name}"
build/torch212-cxx11-cu130-x86_64-linux/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "flashrt-fp8-ffn",
3
- "id": "_flashrt_fp8_ffn_cuda_e9a1fe0",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "flashrt-fp8-ffn",
3
+ "id": "_flashrt_fp8_ffn_cuda_c4d802d",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch212-cxx11-cu132-x86_64-linux/__init__.py CHANGED
@@ -31,7 +31,68 @@ def _preload_cublaslt() -> None:
31
 
32
  _preload_cublaslt()
33
 
34
- from ._ops import ops
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
 
31
 
32
  _preload_cublaslt()
33
 
34
+ from ._ops import add_op_namespace_prefix, ops
35
+
36
+
37
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gemm_bf16"))
38
+ def _fp8_gemm_bf16_fake(
39
+ input: torch.Tensor,
40
+ weight: torch.Tensor,
41
+ input_scale: torch.Tensor,
42
+ weight_scale: torch.Tensor,
43
+ out: torch.Tensor,
44
+ ) -> None:
45
+ if input.dim() != 2 or weight.dim() != 2:
46
+ raise RuntimeError("input and weight must be rank-2 tensors")
47
+ if out.shape != (input.shape[0], weight.shape[0]):
48
+ raise RuntimeError("out shape must be (input.shape[0], weight.shape[0])")
49
+ return None
50
+
51
+
52
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_linear_bias_gelu_quant_bf16"))
53
+ def _fp8_linear_bias_gelu_quant_bf16_fake(
54
+ input: torch.Tensor,
55
+ weight: torch.Tensor,
56
+ bias: torch.Tensor,
57
+ input_scale: torch.Tensor,
58
+ weight_scale: torch.Tensor,
59
+ output_scale: torch.Tensor,
60
+ hidden_bf16: torch.Tensor,
61
+ out_fp8: torch.Tensor,
62
+ ) -> None:
63
+ expected = (input.shape[0], weight.shape[0])
64
+ if hidden_bf16.shape != expected or out_fp8.shape != expected:
65
+ raise RuntimeError(
66
+ "hidden_bf16 and out_fp8 shapes must be "
67
+ "(input.shape[0], weight.shape[0])"
68
+ )
69
+ return None
70
+
71
+
72
+ @torch.library.register_fake(add_op_namespace_prefix("fp8_gelu_mlp_bf16"))
73
+ def _fp8_gelu_mlp_bf16_fake(
74
+ input: torch.Tensor,
75
+ up_weight: torch.Tensor,
76
+ up_bias: torch.Tensor,
77
+ down_weight: torch.Tensor,
78
+ down_bias: torch.Tensor,
79
+ input_scale: torch.Tensor,
80
+ up_weight_scale: torch.Tensor,
81
+ hidden_scale: torch.Tensor,
82
+ down_weight_scale: torch.Tensor,
83
+ hidden_bf16: torch.Tensor,
84
+ hidden_fp8: torch.Tensor,
85
+ out: torch.Tensor,
86
+ ) -> None:
87
+ hidden_shape = (input.shape[0], up_weight.shape[0])
88
+ out_shape = (input.shape[0], down_weight.shape[0])
89
+ if hidden_bf16.shape != hidden_shape or hidden_fp8.shape != hidden_shape:
90
+ raise RuntimeError(
91
+ "hidden buffers must be (input.shape[0], up_weight.shape[0])"
92
+ )
93
+ if out.shape != out_shape:
94
+ raise RuntimeError("out shape must be (input.shape[0], down_weight.shape[0])")
95
+ return None
96
 
97
 
98
  def _scalar_scale_like(input: torch.Tensor, value: float = 1.0) -> torch.Tensor:
build/torch212-cxx11-cu132-x86_64-linux/{_flashrt_fp8_ffn_cuda_e9a1fe0.abi3.so → _flashrt_fp8_ffn_cuda_c4d802d.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:842932c5da32e68a4eef4737ab0264d69a4aef0254fceef283333277a9215c94
3
  size 314112
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f8328f110f9d95e7b0ad793107ec20df893e887ea1ebc4044c0b8a64a4c9210
3
  size 314112
build/torch212-cxx11-cu132-x86_64-linux/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _flashrt_fp8_ffn_cuda_e9a1fe0
3
- ops = torch.ops._flashrt_fp8_ffn_cuda_e9a1fe0
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_flashrt_fp8_ffn_cuda_e9a1fe0::{op_name}"
 
1
  import torch
2
+ from . import _flashrt_fp8_ffn_cuda_c4d802d
3
+ ops = torch.ops._flashrt_fp8_ffn_cuda_c4d802d
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_flashrt_fp8_ffn_cuda_c4d802d::{op_name}"
build/torch212-cxx11-cu132-x86_64-linux/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "flashrt-fp8-ffn",
3
- "id": "_flashrt_fp8_ffn_cuda_e9a1fe0",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "flashrt-fp8-ffn",
3
+ "id": "_flashrt_fp8_ffn_cuda_c4d802d",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],