[Torch 2.11] Guard torch._C._cpu attribute checks for forward compatibility (#35673)
Signed-off-by: atalman <atalman@fb.com>
This commit is contained in:
@@ -280,7 +280,7 @@ class CPUFusedMOE:
|
||||
if not (w13_output_size % 32 == 0 and w2_output_size % 32 == 0):
|
||||
return False, "none"
|
||||
|
||||
supports_amx = torch._C._cpu._is_amx_tile_supported()
|
||||
supports_amx = torch.cpu._is_amx_tile_supported()
|
||||
|
||||
if (
|
||||
supports_amx
|
||||
|
||||
@@ -292,7 +292,7 @@ class CPUAWQLinearMethod(LinearMethodBase):
|
||||
|
||||
|
||||
def _get_isa_hint(dtype: torch.dtype) -> str:
|
||||
supports_amx = torch._C._cpu._is_amx_tile_supported()
|
||||
supports_amx = torch.cpu._is_amx_tile_supported()
|
||||
if supports_amx and dtype in (torch.bfloat16,):
|
||||
return "amx"
|
||||
else:
|
||||
|
||||
@@ -212,7 +212,7 @@ direct_register_custom_op(
|
||||
|
||||
def check_cpu_sgl_kernel(n: int, k: int, dtype: torch.dtype) -> bool:
|
||||
return (
|
||||
torch._C._cpu._is_amx_tile_supported()
|
||||
torch.cpu._is_amx_tile_supported()
|
||||
and (dtype in (torch.bfloat16, torch.int8))
|
||||
and k % 32 == 0
|
||||
and n % 16 == 0
|
||||
|
||||
Reference in New Issue
Block a user