habana-pyhlml 1.17.1.40__py3-none-any.whl → 1.19.0.561__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of habana-pyhlml might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: habana-pyhlml
3
- Version: 1.17.1.40
3
+ Version: 1.19.0.561
4
4
  Summary: Python3 wrapper for the HLML library.
5
5
  Home-page: UNKNOWN
6
6
  Author: HabanaAI
@@ -0,0 +1,10 @@
1
+ pyhlml/__init__.py,sha256=VjbHqSSypSMmVK7UTxuCyOs_AE8HhTXX9EGr6NbaQNk,25
2
+ pyhlml/hlml_error.py,sha256=GQulGXf-jX38jEASXF22qJ0yL8eC57vUo8s9lVI7q_E,2113
3
+ pyhlml/hlml_lib.py,sha256=JiHRLl3vpAozhCSs9eJC8xlhIMxR2wNVZdmahjlgDfc,1430
4
+ pyhlml/hlml_types.py,sha256=AwehWbTpq3D3fAi3U1_hZg88sljr7c4pldoXOo8Yv5Q,11677
5
+ pyhlml/main.py,sha256=U-4PQKZ0RWFVnDWoJrDJ_TBOOhMqtTfshXi7CbR72M8,39118
6
+ habana_pyhlml-1.19.0.561.dist-info/LICENSE,sha256=_J8fTEtZF8y69onNU5_EAdOn0AC9RM2uHPh_q36-5bc,1065
7
+ habana_pyhlml-1.19.0.561.dist-info/METADATA,sha256=eMNrpQ6Do4ZmTt7PBjDX6Guvd1aOtLEHivRJJb1ifDI,1457
8
+ habana_pyhlml-1.19.0.561.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
9
+ habana_pyhlml-1.19.0.561.dist-info/top_level.txt,sha256=0jXJHTTotoeuyzpI1dcVr0mzCVB0NKY7LyCF4OwoMZU,7
10
+ habana_pyhlml-1.19.0.561.dist-info/RECORD,,
pyhlml/hlml_types.py CHANGED
@@ -8,7 +8,7 @@ class HLML_DEVICE:
8
8
  TYPE = ctypes.c_void_p
9
9
 
10
10
  class HLML_DEFINE:
11
- PCI_DOMAIN_LEN = 5
11
+ PCI_DOMAIN_LEN = 9
12
12
  PCI_ADDR_LEN = ( PCI_DOMAIN_LEN + 10 )
13
13
  PCI_LINK_INFO_LEN = 10
14
14
  HL_FIELD_MAX_SIZE = 32
@@ -88,6 +88,22 @@ class HLML_ENABLE_STATE:
88
88
  class HLML_P_STATES:
89
89
  TYPE = ctypes.c_uint
90
90
  HLML_PSTATE_0 = 0
91
+ HLML_PSTATE_1 = 1
92
+ HLML_PSTATE_2 = 2
93
+ HLML_PSTATE_3 = 3
94
+ HLML_PSTATE_4 = 4
95
+ HLML_PSTATE_5 = 5
96
+ HLML_PSTATE_6 = 6
97
+ HLML_PSTATE_7 = 7
98
+ HLML_PSTATE_8 = 8
99
+ HLML_PSTATE_9 = 9
100
+ HLML_PSTATE_10 = 10
101
+ HLML_PSTATE_11 = 11
102
+ HLML_PSTATE_12 = 12
103
+ HLML_PSTATE_13 = 13
104
+ HLML_PSTATE_14 = 14
105
+ HLML_PSTATE_15 = 15
106
+ HLML_PSTATE_SENTINEL = 16
91
107
  HLML_PSTATE_UNKNOWN = 32
92
108
 
93
109
  class HLML_MEMORY_ERROR:
@@ -188,6 +204,7 @@ class c_hlml_pci_info(_PrintS):
188
204
  * device - The device's id on the bus, 0 to 31
189
205
  * domain - The PCI domain on which the device's bus resides
190
206
  * pci_device_id - The combined 16b deviceId and 16b vendor id
207
+ * pci_subsys_device_id - The combined 16b subsys_id and 16b subsys_vendor_id
191
208
  */
192
209
  """
193
210
  _fields_ = [("bus", ctypes.c_uint),
@@ -196,11 +213,18 @@ class c_hlml_pci_info(_PrintS):
196
213
  ("domain", ctypes.c_uint),
197
214
  ("pci_device_id", ctypes.c_uint),
198
215
  ("caps", c_hlml_pci_cap),
199
- ("pci_rev", ctypes.c_uint)
216
+ ("pci_rev", ctypes.c_uint),
217
+ ("pci_subsys_id", ctypes.c_uint)
200
218
  ]
201
219
 
202
220
  class c_hlml_utilization(_PrintS):
203
- _fields_ = [("aip", ctypes.c_uint)]
221
+ _fields_ = [("aip", ctypes.c_uint),
222
+ ("memory", ctypes.c_uint)
223
+ ]
224
+
225
+ class c_hlml_process_utilization(_PrintS):
226
+ _fields_ = [("aip_util", ctypes.c_uint)
227
+ ]
204
228
 
205
229
  class c_hlml_memory(_PrintS):
206
230
  _fields_ = [("free", ctypes.c_ulonglong),
pyhlml/main.py CHANGED
@@ -211,7 +211,24 @@ def hlmlDeviceGetMaxClockInfo(device: hlml_t.HLML_DEVICE.TYPE, clock_type=0 ) ->
211
211
  check_return(ret)
212
212
  return speed.value
213
213
 
214
- def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> int:
214
+ def hlmlDeviceGetClockLimitInfo(device: hlml_t.HLML_DEVICE.TYPE, clock_type=0 ) -> int:
215
+ """ Retrives the frequency limit of the selected clock (MHz)
216
+ Parameters:
217
+ device (HLML_DEVICE.TYPE) - The handle for a habana device.
218
+ clock_type ( 0-SOC ( GAUDI ) / 1-IC ( GOYA ) / 2-MME ( GOYA ) / 3-TPC ( GOYA ) )
219
+ Returns:
220
+ speed (int) - The frequency LIMIT of the selected clock in MHz.
221
+ """
222
+ global _hlmlOBJ
223
+ speed = ctypes.c_uint()
224
+
225
+ fn = _hlmlOBJ.get_func_ptr("hlml_device_get_clock_limit_info")
226
+ ret = fn(device, clock_type, ctypes.byref(speed))
227
+
228
+ check_return(ret)
229
+ return speed.value
230
+
231
+ def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.c_hlml_utilization:
215
232
  """ Returns utilization over the past second as a percentage
216
233
  Parameters:
217
234
  device (HLML_DEVICE.TYPE) - The handle for a habana device.
@@ -225,7 +242,23 @@ def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> int:
225
242
  ret = fn(device, ctypes.byref(hlml_util))
226
243
 
227
244
  check_return(ret)
228
- return hlml_util.aip
245
+ return hlml_util
246
+
247
+ def hlmlDeviceGetProcessUtilization(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.c_hlml_process_utilization:
248
+ """ Returns process utilization over the past second as a percentage
249
+ Parameters:
250
+ device (HLML_DEVICE.TYPE) - The handle for a habana device.
251
+ Returns:
252
+ hlml_util (int) - The utilization rate over the last second as a percentage.
253
+ """
254
+ global _hlmlOBJ
255
+ hlml_util = hlml_t.c_hlml_process_utilization()
256
+
257
+ fn = _hlmlOBJ.get_func_ptr("hlml_device_get_process_utilization")
258
+ ret = fn(device, ctypes.byref(hlml_util))
259
+
260
+ check_return(ret)
261
+ return hlml_util
229
262
 
230
263
  def hlmlDeviceGetMemoryInfo(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.c_hlml_memory:
231
264
  """ Returns the total, used, and free memory in bytes
@@ -326,6 +359,22 @@ def hlmlDeviceGetPowerUsage(device: hlml_t.HLML_DEVICE.TYPE) -> int:
326
359
  check_return(ret)
327
360
  return power.value
328
361
 
362
+ def hlmlDeviceSetPowerManagementLimit(device: hlml_t.HLML_DEVICE.TYPE, limit : ctypes.c_uint) -> None:
363
+ """ Sets power management limit on this device in mW
364
+ Parameters:
365
+ device (HLML_DEVICE.TYPE) - The handle for a habana device.
366
+ limit (ctypes.c_uint) - The power limit on the device in mW.
367
+ Returns:
368
+ ret (HLML_RETURN) - The status of the operation.
369
+ """
370
+ global _hlmlOBJ
371
+
372
+ fn = _hlmlOBJ.get_func_ptr("hlml_device_set_power_management_limit")
373
+ ret = fn(device, limit)
374
+
375
+ check_return(ret)
376
+ return None
377
+
329
378
  def hlmlDeviceGetPowerManagementDefaultLimit(device: hlml_t.HLML_DEVICE.TYPE) -> int:
330
379
  """ Retrieves default power management limit on this device in mW
331
380
  Parameters:
@@ -1063,3 +1112,34 @@ def hlmlDeviceGetOperationStatus(device: hlml_t.HLML_DEVICE.TYPE) -> str:
1063
1112
 
1064
1113
  check_return(ret)
1065
1114
  return sts_str.value
1115
+
1116
+ def hlmlDeviceGetPowerManagementMode(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.HLML_ENABLE_STATE:
1117
+ """ Acquire name of device from handle
1118
+ Parameters:
1119
+ device (HLML_DEVICE.TYPE) - The handle for a habana device.
1120
+ Returns:
1121
+ mode (int) - The power management mode of the device.
1122
+ """
1123
+ global _hlmlOBJ
1124
+ mode = ctypes.c_uint()
1125
+ fn = _hlmlOBJ.get_func_ptr("hlml_device_get_power_management_mode")
1126
+ ret = fn(device, ctypes.byref(mode))
1127
+
1128
+ check_return(ret)
1129
+ return mode.value
1130
+
1131
+ def hlmlDeviceGetPowerManagementLimit(device: hlml_t.HLML_DEVICE.TYPE) -> int:
1132
+ """ Returns the pending status of replaced rows.
1133
+ Parameters:
1134
+ device (HLML_DEVICE.TYPE) - The handle for a habana device.
1135
+ Returns:
1136
+ limit (int) - Reference in which to return the power management
1137
+ limit in mW
1138
+ """
1139
+ global _hlmlOBJ
1140
+ power_max = ctypes.c_uint()
1141
+ fn = _hlmlOBJ.get_func_ptr("hlml_device_get_power_management_limit")
1142
+ ret = fn(device, ctypes.byref(power_max))
1143
+
1144
+ check_return(ret)
1145
+ return power_max.value
@@ -1,10 +0,0 @@
1
- pyhlml/__init__.py,sha256=VjbHqSSypSMmVK7UTxuCyOs_AE8HhTXX9EGr6NbaQNk,25
2
- pyhlml/hlml_error.py,sha256=GQulGXf-jX38jEASXF22qJ0yL8eC57vUo8s9lVI7q_E,2113
3
- pyhlml/hlml_lib.py,sha256=JiHRLl3vpAozhCSs9eJC8xlhIMxR2wNVZdmahjlgDfc,1430
4
- pyhlml/hlml_types.py,sha256=znPABbbwxHfSRiUO4lepgnJumVweRx3AWoU9R84aTss,10603
5
- pyhlml/main.py,sha256=r9wnlzK9qVY2RdxoSpGxbnYyQbS1HKijPkHjogeEEwY,36135
6
- habana_pyhlml-1.17.1.40.dist-info/LICENSE,sha256=_J8fTEtZF8y69onNU5_EAdOn0AC9RM2uHPh_q36-5bc,1065
7
- habana_pyhlml-1.17.1.40.dist-info/METADATA,sha256=vXftSslewDYDHkse6mu7xD3G4aiWD8N5TDqnUI6bkOw,1456
8
- habana_pyhlml-1.17.1.40.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
9
- habana_pyhlml-1.17.1.40.dist-info/top_level.txt,sha256=0jXJHTTotoeuyzpI1dcVr0mzCVB0NKY7LyCF4OwoMZU,7
10
- habana_pyhlml-1.17.1.40.dist-info/RECORD,,