tilelang.carver.arch.driver.ascend_driver¶

Functions¶

get_ascend_device_properties([device_id])

Get raw torch_npu device properties object for the given device.

get_device_name([device_id])

Get the device name (e.g. 'Ascend950PR_9589').

get_num_cube_cores([device_id])

Get the number of AI Cube cores (matmul units) on the device.

get_num_vector_cores([device_id])

Get the number of AI Vector cores (SIMD units) on the device.

get_total_memory([device_id, format])

Get the total HBM memory of the device in bytes, kb, mb, or gb.

get_l2_cache_size([device_id, format])

Get the L2 cache size of the device in bytes, kb, or mb.

Module Contents¶

tilelang.carver.arch.driver.ascend_driver.get_ascend_device_properties(device_id=0)¶

Get raw torch_npu device properties object for the given device.

Returns None if torch_npu or the NPU device is not available.

Parameters:

device_id (int)

tilelang.carver.arch.driver.ascend_driver.get_device_name(device_id=0)¶

Get the device name (e.g. ‘Ascend950PR_9589’).

Parameters:

device_id (int)

Return type:

str | None

tilelang.carver.arch.driver.ascend_driver.get_num_cube_cores(device_id=0)¶

Get the number of AI Cube cores (matmul units) on the device.

Parameters:

device_id (int)

Return type:

int | None

tilelang.carver.arch.driver.ascend_driver.get_num_vector_cores(device_id=0)¶

Get the number of AI Vector cores (SIMD units) on the device.

Parameters:

device_id (int)

Return type:

int | None

tilelang.carver.arch.driver.ascend_driver.get_total_memory(device_id=0, format='bytes')¶

Get the total HBM memory of the device in bytes, kb, mb, or gb.

Parameters:
  • device_id (int)

  • format (str)

Return type:

int | None

tilelang.carver.arch.driver.ascend_driver.get_l2_cache_size(device_id=0, format='bytes')¶

Get the L2 cache size of the device in bytes, kb, or mb.

Parameters:
  • device_id (int)

  • format (str)

Return type:

int | None