danieldk HF Staff commited on
Commit
229f047
·
1 Parent(s): 82ffd1f

Build (aarch64)

Browse files
Files changed (20) hide show
  1. build/torch26-cxx11-cu126-aarch64-linux/quantization/__init__.py +9 -0
  2. build/torch26-cxx11-cu126-aarch64-linux/quantization/_ops.py +3 -3
  3. build/torch26-cxx11-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} +2 -2
  4. build/torch26-cxx11-cu126-aarch64-linux/quantization/compressed_tensors.py +3 -1
  5. build/torch26-cxx11-cu126-aarch64-linux/quantization/platforms.py +35 -0
  6. build/torch26-cxx98-cu126-aarch64-linux/quantization/__init__.py +9 -0
  7. build/torch26-cxx98-cu126-aarch64-linux/quantization/_ops.py +3 -3
  8. build/torch26-cxx98-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} +1 -1
  9. build/torch26-cxx98-cu126-aarch64-linux/quantization/compressed_tensors.py +3 -1
  10. build/torch26-cxx98-cu126-aarch64-linux/quantization/platforms.py +35 -0
  11. build/torch27-cxx11-cu126-aarch64-linux/quantization/__init__.py +9 -0
  12. build/torch27-cxx11-cu126-aarch64-linux/quantization/_ops.py +3 -3
  13. build/torch27-cxx11-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} +2 -2
  14. build/torch27-cxx11-cu126-aarch64-linux/quantization/compressed_tensors.py +3 -1
  15. build/torch27-cxx11-cu126-aarch64-linux/quantization/platforms.py +35 -0
  16. build/torch27-cxx11-cu128-aarch64-linux/quantization/__init__.py +9 -0
  17. build/torch27-cxx11-cu128-aarch64-linux/quantization/_ops.py +3 -3
  18. build/torch27-cxx11-cu128-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} +2 -2
  19. build/torch27-cxx11-cu128-aarch64-linux/quantization/compressed_tensors.py +3 -1
  20. build/torch27-cxx11-cu128-aarch64-linux/quantization/platforms.py +35 -0
build/torch26-cxx11-cu126-aarch64-linux/quantization/__init__.py CHANGED
@@ -19,6 +19,11 @@ from .scalar_type import (
19
  )
20
  from ._ops import ops
21
 
 
 
 
 
 
22
 
23
  __all__ = [
24
  "ScalarType",
@@ -32,7 +37,11 @@ __all__ = [
32
  "gptq_marlin_repack",
33
  "marlin_gemm",
34
  "marlin_qqq_gemm",
 
 
 
35
  "ops",
 
36
  "scalar_types",
37
  "scaled_fp8_quant",
38
  "scaled_int8_quant",
 
19
  )
20
  from ._ops import ops
21
 
22
+ from .utils import marlin_utils
23
+ from .utils import marlin_utils_fp4
24
+ from .utils import marlin_utils_fp8
25
+ from .utils import quant_utils
26
+
27
 
28
  __all__ = [
29
  "ScalarType",
 
37
  "gptq_marlin_repack",
38
  "marlin_gemm",
39
  "marlin_qqq_gemm",
40
+ "marlin_utils",
41
+ "marlin_utils_fp4",
42
+ "marlin_utils_fp8",
43
  "ops",
44
+ "quant_utils",
45
  "scalar_types",
46
  "scaled_fp8_quant",
47
  "scaled_int8_quant",
build/torch26-cxx11-cu126-aarch64-linux/quantization/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _quantization_9035540
3
- ops = torch.ops._quantization_9035540
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_quantization_9035540::{op_name}"
 
1
  import torch
2
+ from . import _quantization_82ffd1f
3
+ ops = torch.ops._quantization_82ffd1f
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_quantization_82ffd1f::{op_name}"
build/torch26-cxx11-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:aee128710f3a8587386120a226a6caddd5e77cd7a0296a1f7fad51b4028550b1
3
- size 159934120
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:163383785e3ca9a472f18c802591218f18ef3c9cde4bb83fa623575a8adfd085
3
+ size 159999656
build/torch26-cxx11-cu126-aarch64-linux/quantization/compressed_tensors.py CHANGED
@@ -1,8 +1,10 @@
1
- from typing import Optional, Tuple
2
 
3
  import torch
4
 
5
  from ._ops import ops
 
 
6
 
7
  # fp8
8
  def scaled_fp8_quant(
 
1
+ from typing import Optional, Union
2
 
3
  import torch
4
 
5
  from ._ops import ops
6
+ from .platforms import current_platform
7
+
8
 
9
  # fp8
10
  def scaled_fp8_quant(
build/torch26-cxx11-cu126-aarch64-linux/quantization/platforms.py CHANGED
@@ -27,6 +27,29 @@ class DeviceCapability(NamedTuple):
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  @classmethod
31
  @abstractmethod
32
  def get_device_name(cls, device_id: int = 0) -> str: ...
@@ -51,6 +74,18 @@ class CudaPlatform(Platform):
51
 
52
 
53
  class RocmPlatform(Platform):
 
 
 
 
 
 
 
 
 
 
 
 
54
  @classmethod
55
  @lru_cache(maxsize=8)
56
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
 
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
30
+ @classmethod
31
+ def fp8_dtype(cls) -> torch.dtype:
32
+ """
33
+ Returns the preferred FP8 type on the current platform.
34
+
35
+ See the documentation for is_fp8_fnuz for details.
36
+ """
37
+ return torch.float8_e4m3fn
38
+
39
+ @classmethod
40
+ def is_fp8_fnuz(cls) -> bool:
41
+ """
42
+ Returns whether the preferred FP8 type is FNUZ on the current platform.
43
+
44
+ There are two representations of FP8, OCP FP8 and FNUZ FP8.
45
+ The OCP specification can be found at https://tinyurl.com/b7jvwpft.
46
+ The FNUZ specification can be found at https://tinyurl.com/5n6hwwu5.
47
+
48
+ AMD's MI300 and MI325 have native hardware support for FNUZ. All other
49
+ hardware has converged on the OCP FP8 standard.
50
+ """
51
+ return False
52
+
53
  @classmethod
54
  @abstractmethod
55
  def get_device_name(cls, device_id: int = 0) -> str: ...
 
74
 
75
 
76
  class RocmPlatform(Platform):
77
+ @classmethod
78
+ def fp8_dtype(cls) -> torch.dtype:
79
+ if cls.is_fp8_fnuz():
80
+ return torch.float8_e4m3fnuz
81
+ else:
82
+ return torch.float8_e4m3fn
83
+
84
+ @classmethod
85
+ def is_fp8_fnuz(cls) -> bool:
86
+ # only device 0 is checked, this assumes MI300 platforms are homogeneous
87
+ return "gfx94" in torch.cuda.get_device_properties(0).gcnArchName
88
+
89
  @classmethod
90
  @lru_cache(maxsize=8)
91
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
build/torch26-cxx98-cu126-aarch64-linux/quantization/__init__.py CHANGED
@@ -19,6 +19,11 @@ from .scalar_type import (
19
  )
20
  from ._ops import ops
21
 
 
 
 
 
 
22
 
23
  __all__ = [
24
  "ScalarType",
@@ -32,7 +37,11 @@ __all__ = [
32
  "gptq_marlin_repack",
33
  "marlin_gemm",
34
  "marlin_qqq_gemm",
 
 
 
35
  "ops",
 
36
  "scalar_types",
37
  "scaled_fp8_quant",
38
  "scaled_int8_quant",
 
19
  )
20
  from ._ops import ops
21
 
22
+ from .utils import marlin_utils
23
+ from .utils import marlin_utils_fp4
24
+ from .utils import marlin_utils_fp8
25
+ from .utils import quant_utils
26
+
27
 
28
  __all__ = [
29
  "ScalarType",
 
37
  "gptq_marlin_repack",
38
  "marlin_gemm",
39
  "marlin_qqq_gemm",
40
+ "marlin_utils",
41
+ "marlin_utils_fp4",
42
+ "marlin_utils_fp8",
43
  "ops",
44
+ "quant_utils",
45
  "scalar_types",
46
  "scaled_fp8_quant",
47
  "scaled_int8_quant",
build/torch26-cxx98-cu126-aarch64-linux/quantization/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _quantization_9035540
3
- ops = torch.ops._quantization_9035540
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_quantization_9035540::{op_name}"
 
1
  import torch
2
+ from . import _quantization_82ffd1f
3
+ ops = torch.ops._quantization_82ffd1f
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_quantization_82ffd1f::{op_name}"
build/torch26-cxx98-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3685a434362226370f1956f59790a58d2f4c8999f9f35acafd25ca9d73bfc5ae
3
  size 159991696
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2bf0942eeeb2b821331211fc74ce7c37fccad95fc1ac6aa8bbc322a6f8ac249
3
  size 159991696
build/torch26-cxx98-cu126-aarch64-linux/quantization/compressed_tensors.py CHANGED
@@ -1,8 +1,10 @@
1
- from typing import Optional, Tuple
2
 
3
  import torch
4
 
5
  from ._ops import ops
 
 
6
 
7
  # fp8
8
  def scaled_fp8_quant(
 
1
+ from typing import Optional, Union
2
 
3
  import torch
4
 
5
  from ._ops import ops
6
+ from .platforms import current_platform
7
+
8
 
9
  # fp8
10
  def scaled_fp8_quant(
build/torch26-cxx98-cu126-aarch64-linux/quantization/platforms.py CHANGED
@@ -27,6 +27,29 @@ class DeviceCapability(NamedTuple):
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  @classmethod
31
  @abstractmethod
32
  def get_device_name(cls, device_id: int = 0) -> str: ...
@@ -51,6 +74,18 @@ class CudaPlatform(Platform):
51
 
52
 
53
  class RocmPlatform(Platform):
 
 
 
 
 
 
 
 
 
 
 
 
54
  @classmethod
55
  @lru_cache(maxsize=8)
56
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
 
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
30
+ @classmethod
31
+ def fp8_dtype(cls) -> torch.dtype:
32
+ """
33
+ Returns the preferred FP8 type on the current platform.
34
+
35
+ See the documentation for is_fp8_fnuz for details.
36
+ """
37
+ return torch.float8_e4m3fn
38
+
39
+ @classmethod
40
+ def is_fp8_fnuz(cls) -> bool:
41
+ """
42
+ Returns whether the preferred FP8 type is FNUZ on the current platform.
43
+
44
+ There are two representations of FP8, OCP FP8 and FNUZ FP8.
45
+ The OCP specification can be found at https://tinyurl.com/b7jvwpft.
46
+ The FNUZ specification can be found at https://tinyurl.com/5n6hwwu5.
47
+
48
+ AMD's MI300 and MI325 have native hardware support for FNUZ. All other
49
+ hardware has converged on the OCP FP8 standard.
50
+ """
51
+ return False
52
+
53
  @classmethod
54
  @abstractmethod
55
  def get_device_name(cls, device_id: int = 0) -> str: ...
 
74
 
75
 
76
  class RocmPlatform(Platform):
77
+ @classmethod
78
+ def fp8_dtype(cls) -> torch.dtype:
79
+ if cls.is_fp8_fnuz():
80
+ return torch.float8_e4m3fnuz
81
+ else:
82
+ return torch.float8_e4m3fn
83
+
84
+ @classmethod
85
+ def is_fp8_fnuz(cls) -> bool:
86
+ # only device 0 is checked, this assumes MI300 platforms are homogeneous
87
+ return "gfx94" in torch.cuda.get_device_properties(0).gcnArchName
88
+
89
  @classmethod
90
  @lru_cache(maxsize=8)
91
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
build/torch27-cxx11-cu126-aarch64-linux/quantization/__init__.py CHANGED
@@ -19,6 +19,11 @@ from .scalar_type import (
19
  )
20
  from ._ops import ops
21
 
 
 
 
 
 
22
 
23
  __all__ = [
24
  "ScalarType",
@@ -32,7 +37,11 @@ __all__ = [
32
  "gptq_marlin_repack",
33
  "marlin_gemm",
34
  "marlin_qqq_gemm",
 
 
 
35
  "ops",
 
36
  "scalar_types",
37
  "scaled_fp8_quant",
38
  "scaled_int8_quant",
 
19
  )
20
  from ._ops import ops
21
 
22
+ from .utils import marlin_utils
23
+ from .utils import marlin_utils_fp4
24
+ from .utils import marlin_utils_fp8
25
+ from .utils import quant_utils
26
+
27
 
28
  __all__ = [
29
  "ScalarType",
 
37
  "gptq_marlin_repack",
38
  "marlin_gemm",
39
  "marlin_qqq_gemm",
40
+ "marlin_utils",
41
+ "marlin_utils_fp4",
42
+ "marlin_utils_fp8",
43
  "ops",
44
+ "quant_utils",
45
  "scalar_types",
46
  "scaled_fp8_quant",
47
  "scaled_int8_quant",
build/torch27-cxx11-cu126-aarch64-linux/quantization/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _quantization_9035540
3
- ops = torch.ops._quantization_9035540
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_quantization_9035540::{op_name}"
 
1
  import torch
2
+ from . import _quantization_82ffd1f
3
+ ops = torch.ops._quantization_82ffd1f
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_quantization_82ffd1f::{op_name}"
build/torch27-cxx11-cu126-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:219fc94b48e46777769dd2cd61785791b4fd00c58824d6de5252defbf48c30e5
3
- size 159999608
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef0e68ff25982049ce0b6af570f6546c8f62a49e373397d352f89376c1805de4
3
+ size 159934080
build/torch27-cxx11-cu126-aarch64-linux/quantization/compressed_tensors.py CHANGED
@@ -1,8 +1,10 @@
1
- from typing import Optional, Tuple
2
 
3
  import torch
4
 
5
  from ._ops import ops
 
 
6
 
7
  # fp8
8
  def scaled_fp8_quant(
 
1
+ from typing import Optional, Union
2
 
3
  import torch
4
 
5
  from ._ops import ops
6
+ from .platforms import current_platform
7
+
8
 
9
  # fp8
10
  def scaled_fp8_quant(
build/torch27-cxx11-cu126-aarch64-linux/quantization/platforms.py CHANGED
@@ -27,6 +27,29 @@ class DeviceCapability(NamedTuple):
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  @classmethod
31
  @abstractmethod
32
  def get_device_name(cls, device_id: int = 0) -> str: ...
@@ -51,6 +74,18 @@ class CudaPlatform(Platform):
51
 
52
 
53
  class RocmPlatform(Platform):
 
 
 
 
 
 
 
 
 
 
 
 
54
  @classmethod
55
  @lru_cache(maxsize=8)
56
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
 
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
30
+ @classmethod
31
+ def fp8_dtype(cls) -> torch.dtype:
32
+ """
33
+ Returns the preferred FP8 type on the current platform.
34
+
35
+ See the documentation for is_fp8_fnuz for details.
36
+ """
37
+ return torch.float8_e4m3fn
38
+
39
+ @classmethod
40
+ def is_fp8_fnuz(cls) -> bool:
41
+ """
42
+ Returns whether the preferred FP8 type is FNUZ on the current platform.
43
+
44
+ There are two representations of FP8, OCP FP8 and FNUZ FP8.
45
+ The OCP specification can be found at https://tinyurl.com/b7jvwpft.
46
+ The FNUZ specification can be found at https://tinyurl.com/5n6hwwu5.
47
+
48
+ AMD's MI300 and MI325 have native hardware support for FNUZ. All other
49
+ hardware has converged on the OCP FP8 standard.
50
+ """
51
+ return False
52
+
53
  @classmethod
54
  @abstractmethod
55
  def get_device_name(cls, device_id: int = 0) -> str: ...
 
74
 
75
 
76
  class RocmPlatform(Platform):
77
+ @classmethod
78
+ def fp8_dtype(cls) -> torch.dtype:
79
+ if cls.is_fp8_fnuz():
80
+ return torch.float8_e4m3fnuz
81
+ else:
82
+ return torch.float8_e4m3fn
83
+
84
+ @classmethod
85
+ def is_fp8_fnuz(cls) -> bool:
86
+ # only device 0 is checked, this assumes MI300 platforms are homogeneous
87
+ return "gfx94" in torch.cuda.get_device_properties(0).gcnArchName
88
+
89
  @classmethod
90
  @lru_cache(maxsize=8)
91
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
build/torch27-cxx11-cu128-aarch64-linux/quantization/__init__.py CHANGED
@@ -19,6 +19,11 @@ from .scalar_type import (
19
  )
20
  from ._ops import ops
21
 
 
 
 
 
 
22
 
23
  __all__ = [
24
  "ScalarType",
@@ -32,7 +37,11 @@ __all__ = [
32
  "gptq_marlin_repack",
33
  "marlin_gemm",
34
  "marlin_qqq_gemm",
 
 
 
35
  "ops",
 
36
  "scalar_types",
37
  "scaled_fp8_quant",
38
  "scaled_int8_quant",
 
19
  )
20
  from ._ops import ops
21
 
22
+ from .utils import marlin_utils
23
+ from .utils import marlin_utils_fp4
24
+ from .utils import marlin_utils_fp8
25
+ from .utils import quant_utils
26
+
27
 
28
  __all__ = [
29
  "ScalarType",
 
37
  "gptq_marlin_repack",
38
  "marlin_gemm",
39
  "marlin_qqq_gemm",
40
+ "marlin_utils",
41
+ "marlin_utils_fp4",
42
+ "marlin_utils_fp8",
43
  "ops",
44
+ "quant_utils",
45
  "scalar_types",
46
  "scaled_fp8_quant",
47
  "scaled_int8_quant",
build/torch27-cxx11-cu128-aarch64-linux/quantization/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _quantization_9035540
3
- ops = torch.ops._quantization_9035540
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_quantization_9035540::{op_name}"
 
1
  import torch
2
+ from . import _quantization_82ffd1f
3
+ ops = torch.ops._quantization_82ffd1f
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_quantization_82ffd1f::{op_name}"
build/torch27-cxx11-cu128-aarch64-linux/quantization/{_quantization_9035540.abi3.so → _quantization_82ffd1f.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4d670f7d449a8d177ce46784fb4617dcb0edc30f8d8a62305ed1213310256167
3
- size 296561248
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c8d85c6222df8ff6de82adbad94502fdc5c1910dbaa367034c8975c4f85244a
3
+ size 296561256
build/torch27-cxx11-cu128-aarch64-linux/quantization/compressed_tensors.py CHANGED
@@ -1,8 +1,10 @@
1
- from typing import Optional, Tuple
2
 
3
  import torch
4
 
5
  from ._ops import ops
 
 
6
 
7
  # fp8
8
  def scaled_fp8_quant(
 
1
+ from typing import Optional, Union
2
 
3
  import torch
4
 
5
  from ._ops import ops
6
+ from .platforms import current_platform
7
+
8
 
9
  # fp8
10
  def scaled_fp8_quant(
build/torch27-cxx11-cu128-aarch64-linux/quantization/platforms.py CHANGED
@@ -27,6 +27,29 @@ class DeviceCapability(NamedTuple):
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  @classmethod
31
  @abstractmethod
32
  def get_device_name(cls, device_id: int = 0) -> str: ...
@@ -51,6 +74,18 @@ class CudaPlatform(Platform):
51
 
52
 
53
  class RocmPlatform(Platform):
 
 
 
 
 
 
 
 
 
 
 
 
54
  @classmethod
55
  @lru_cache(maxsize=8)
56
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
 
27
  class Platform(ABC):
28
  simple_compile_backend: str = "inductor"
29
 
30
+ @classmethod
31
+ def fp8_dtype(cls) -> torch.dtype:
32
+ """
33
+ Returns the preferred FP8 type on the current platform.
34
+
35
+ See the documentation for is_fp8_fnuz for details.
36
+ """
37
+ return torch.float8_e4m3fn
38
+
39
+ @classmethod
40
+ def is_fp8_fnuz(cls) -> bool:
41
+ """
42
+ Returns whether the preferred FP8 type is FNUZ on the current platform.
43
+
44
+ There are two representations of FP8, OCP FP8 and FNUZ FP8.
45
+ The OCP specification can be found at https://tinyurl.com/b7jvwpft.
46
+ The FNUZ specification can be found at https://tinyurl.com/5n6hwwu5.
47
+
48
+ AMD's MI300 and MI325 have native hardware support for FNUZ. All other
49
+ hardware has converged on the OCP FP8 standard.
50
+ """
51
+ return False
52
+
53
  @classmethod
54
  @abstractmethod
55
  def get_device_name(cls, device_id: int = 0) -> str: ...
 
74
 
75
 
76
  class RocmPlatform(Platform):
77
+ @classmethod
78
+ def fp8_dtype(cls) -> torch.dtype:
79
+ if cls.is_fp8_fnuz():
80
+ return torch.float8_e4m3fnuz
81
+ else:
82
+ return torch.float8_e4m3fn
83
+
84
+ @classmethod
85
+ def is_fp8_fnuz(cls) -> bool:
86
+ # only device 0 is checked, this assumes MI300 platforms are homogeneous
87
+ return "gfx94" in torch.cuda.get_device_properties(0).gcnArchName
88
+
89
  @classmethod
90
  @lru_cache(maxsize=8)
91
  def get_device_capability(cls, device_id: int = 0) -> DeviceCapability: