habana-pyhlml 1.18.0.524__py3-none-any.whl → 1.19.1.26__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.18.0.524
3
+ Version: 1.19.1.26
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.1.26.dist-info/LICENSE,sha256=_J8fTEtZF8y69onNU5_EAdOn0AC9RM2uHPh_q36-5bc,1065
7
+ habana_pyhlml-1.19.1.26.dist-info/METADATA,sha256=jScvelZl6vedKv4rkuRBn-b8dCS0JdaGPNRNV1aILDE,1456
8
+ habana_pyhlml-1.19.1.26.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
9
+ habana_pyhlml-1.19.1.26.dist-info/top_level.txt,sha256=0jXJHTTotoeuyzpI1dcVr0mzCVB0NKY7LyCF4OwoMZU,7
10
+ habana_pyhlml-1.19.1.26.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:
@@ -202,7 +218,13 @@ class c_hlml_pci_info(_PrintS):
202
218
  ]
203
219
 
204
220
  class c_hlml_utilization(_PrintS):
205
- _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
+ ]
206
228
 
207
229
  class c_hlml_memory(_PrintS):
208
230
  _fields_ = [("free", ctypes.c_ulonglong),
pyhlml/main.py CHANGED
@@ -228,7 +228,7 @@ def hlmlDeviceGetClockLimitInfo(device: hlml_t.HLML_DEVICE.TYPE, clock_type=0 )
228
228
  check_return(ret)
229
229
  return speed.value
230
230
 
231
- def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> int:
231
+ def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.c_hlml_utilization:
232
232
  """ Returns utilization over the past second as a percentage
233
233
  Parameters:
234
234
  device (HLML_DEVICE.TYPE) - The handle for a habana device.
@@ -242,7 +242,23 @@ def hlmlDeviceGetUtilizationRates(device: hlml_t.HLML_DEVICE.TYPE) -> int:
242
242
  ret = fn(device, ctypes.byref(hlml_util))
243
243
 
244
244
  check_return(ret)
245
- 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
246
262
 
247
263
  def hlmlDeviceGetMemoryInfo(device: hlml_t.HLML_DEVICE.TYPE) -> hlml_t.c_hlml_memory:
248
264
  """ Returns the total, used, and free memory in bytes
@@ -343,6 +359,22 @@ def hlmlDeviceGetPowerUsage(device: hlml_t.HLML_DEVICE.TYPE) -> int:
343
359
  check_return(ret)
344
360
  return power.value
345
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
+
346
378
  def hlmlDeviceGetPowerManagementDefaultLimit(device: hlml_t.HLML_DEVICE.TYPE) -> int:
347
379
  """ Retrieves default power management limit on this device in mW
348
380
  Parameters:
@@ -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=agWxLywPOHqmkWuUJqFd5raRtPNG5qvqOorbiXE90bw,10738
5
- pyhlml/main.py,sha256=TifTYyaDoLiBs8qZESFpnVdFt9QB4kgRS-9uMBOWqPo,37907
6
- habana_pyhlml-1.18.0.524.dist-info/LICENSE,sha256=_J8fTEtZF8y69onNU5_EAdOn0AC9RM2uHPh_q36-5bc,1065
7
- habana_pyhlml-1.18.0.524.dist-info/METADATA,sha256=CrVsiG5Ax8x6nNXhtRbm0hUu_dsSVf-7Q38q_FAjWsE,1457
8
- habana_pyhlml-1.18.0.524.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
9
- habana_pyhlml-1.18.0.524.dist-info/top_level.txt,sha256=0jXJHTTotoeuyzpI1dcVr0mzCVB0NKY7LyCF4OwoMZU,7
10
- habana_pyhlml-1.18.0.524.dist-info/RECORD,,