Enable use_batch_forward Optimization on Battlemage GPU (#12516)
* Update get_xpu_device_type() to support bmg * enable use_batch_forward for bmg * Update low_bit_linear.py * Update utils.py * use batch kernel for fp8e5
This commit is contained in:
parent
6fc27da9c1
commit
2cce89691a
2 changed files with 3 additions and 0 deletions
|
|
@ -405,6 +405,7 @@ def use_batch_forward(x: torch.Tensor, qtype: int, output_len: int):
|
||||||
or (device in ["arc", "flex"] and qtype in [SYM_INT8, FP4])
|
or (device in ["arc", "flex"] and qtype in [SYM_INT8, FP4])
|
||||||
or (device in ["arc", "flex", "mtl"] and qtype in [FP8E4])
|
or (device in ["arc", "flex", "mtl"] and qtype in [FP8E4])
|
||||||
or (device in ["lnl"] and qtype in [SYM_INT4] and x.shape[1] % 512 == 0)
|
or (device in ["lnl"] and qtype in [SYM_INT4] and x.shape[1] % 512 == 0)
|
||||||
|
or (device in ["bmg"] and qtype in [SYM_INT4, FP8E5])
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,8 @@ def get_xpu_device_type(x):
|
||||||
name = torch.xpu.get_device_name(x.device.index)
|
name = torch.xpu.get_device_name(x.device.index)
|
||||||
if name.startswith("Intel(R) Arc(TM) A"):
|
if name.startswith("Intel(R) Arc(TM) A"):
|
||||||
return "arc"
|
return "arc"
|
||||||
|
elif name.startswith("Intel(R) Graphics [0xe20b]"):
|
||||||
|
return "bmg"
|
||||||
elif name.startswith("Intel(R) Arc(TM)"):
|
elif name.startswith("Intel(R) Arc(TM)"):
|
||||||
if 'V' in name:
|
if 'V' in name:
|
||||||
return "lnl"
|
return "lnl"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue