halib 0.1.82__py3-none-any.whl → 0.1.84__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.
- halib/research/profiler.py +7 -6
- {halib-0.1.82.dist-info → halib-0.1.84.dist-info}/METADATA +2 -2
- {halib-0.1.82.dist-info → halib-0.1.84.dist-info}/RECORD +6 -6
- {halib-0.1.82.dist-info → halib-0.1.84.dist-info}/WHEEL +0 -0
- {halib-0.1.82.dist-info → halib-0.1.84.dist-info}/licenses/LICENSE.txt +0 -0
- {halib-0.1.82.dist-info → halib-0.1.84.dist-info}/top_level.txt +0 -0
halib/research/profiler.py
CHANGED
@@ -170,7 +170,7 @@ class zProfiler:
|
|
170
170
|
@classmethod
|
171
171
|
@classmethod
|
172
172
|
def plot_formatted_data(
|
173
|
-
cls, profiler_data, outdir=None, file_format="png", do_show=False
|
173
|
+
cls, profiler_data, outdir=None, file_format="png", do_show=False, tag=""
|
174
174
|
):
|
175
175
|
"""
|
176
176
|
Plot each context in a separate figure with bar + pie charts.
|
@@ -238,10 +238,10 @@ class zProfiler:
|
|
238
238
|
row=1,
|
239
239
|
col=2,
|
240
240
|
)
|
241
|
-
|
241
|
+
tag_str = f"[{tag}]" if tag else ""
|
242
242
|
# Layout
|
243
243
|
fig.update_layout(
|
244
|
-
title_text=f"Context Profiler: {ctx}",
|
244
|
+
title_text=f"[{tag_str} Context Profiler: {ctx}",
|
245
245
|
width=1000,
|
246
246
|
height=400,
|
247
247
|
showlegend=True,
|
@@ -258,7 +258,8 @@ class zProfiler:
|
|
258
258
|
|
259
259
|
# Save figure
|
260
260
|
if outdir is not None:
|
261
|
-
|
261
|
+
file_prefix = {ctx} if len(tag_str) == 0 else f"{tag_str}_{ctx}"
|
262
|
+
file_path = os.path.join(outdir, f"{file_prefix}_summary.{file_format.lower()}")
|
262
263
|
fig.write_image(file_path)
|
263
264
|
print(f"Saved figure: {file_path}")
|
264
265
|
|
@@ -266,7 +267,7 @@ class zProfiler:
|
|
266
267
|
|
267
268
|
return results
|
268
269
|
|
269
|
-
def report_and_plot(self, outdir=None, file_format="png", do_show=False):
|
270
|
+
def report_and_plot(self, outdir=None, file_format="png", do_show=False, tag=""):
|
270
271
|
"""
|
271
272
|
Generate the profiling report and plot the formatted data.
|
272
273
|
|
@@ -278,7 +279,7 @@ class zProfiler:
|
|
278
279
|
report = self.get_report_dict()
|
279
280
|
self.get_report_dict(with_detail=False)
|
280
281
|
return self.plot_formatted_data(
|
281
|
-
report, outdir=outdir, file_format=file_format, do_show=do_show
|
282
|
+
report, outdir=outdir, file_format=file_format, do_show=do_show, tag=tag
|
282
283
|
)
|
283
284
|
def meta_info(self):
|
284
285
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: halib
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.84
|
4
4
|
Summary: Small library for common tasks
|
5
5
|
Author: Hoang Van Ha
|
6
6
|
Author-email: hoangvanhauit@gmail.com
|
@@ -52,7 +52,7 @@ Dynamic: summary
|
|
52
52
|
|
53
53
|
Helper package for coding and automation
|
54
54
|
|
55
|
-
**Version 0.1.
|
55
|
+
**Version 0.1.84**
|
56
56
|
|
57
57
|
+ `research/profiler`: add `zProfiler` class to measure execution time of contexts and steps, with support for dynamic color scales in plots.
|
58
58
|
|
@@ -36,7 +36,7 @@ halib/research/metrics.py,sha256=Xgv0GUGo-o-RJaBOmkRCRpQJaYijF_1xeKkyYU_Bv4U,524
|
|
36
36
|
halib/research/perfcalc.py,sha256=qDa0sqfpWrwGZVJtjuUVFK7JX6j8xyXP9OnnfYmdamg,15898
|
37
37
|
halib/research/perftb.py,sha256=FWg0b8wSgy4UwuvHSXwEqvTq1Rhi-z-HtAKuQg1lWc4,30989
|
38
38
|
halib/research/plot.py,sha256=-pDUk4z3C_GnyJ5zWmf-mGMdT4gaipVJWzIgcpIPiRk,9448
|
39
|
-
halib/research/profiler.py,sha256=
|
39
|
+
halib/research/profiler.py,sha256=IW__mJbOypes_Vl5VNVB9YQS-xIpLJN_l7iuzZyK_q8,11761
|
40
40
|
halib/research/torchloader.py,sha256=yqUjcSiME6H5W210363HyRUrOi3ISpUFAFkTr1w4DCw,6503
|
41
41
|
halib/research/wandb_op.py,sha256=YzLEqME5kIRxi3VvjFkW83wnFrsn92oYeqYuNwtYRkY,4188
|
42
42
|
halib/sys/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -52,8 +52,8 @@ halib/utils/gpu_mon.py,sha256=vD41_ZnmPLKguuq9X44SB_vwd9JrblO4BDzHLXZhhFY,2233
|
|
52
52
|
halib/utils/listop.py,sha256=Vpa8_2fI0wySpB2-8sfTBkyi_A4FhoFVVvFiuvW8N64,339
|
53
53
|
halib/utils/tele_noti.py,sha256=-4WXZelCA4W9BroapkRyIdUu9cUVrcJJhegnMs_WpGU,5928
|
54
54
|
halib/utils/video.py,sha256=ZqzNVPgc1RZr_T0OlHvZ6SzyBpL7O27LtB86JMbBuR0,3059
|
55
|
-
halib-0.1.
|
56
|
-
halib-0.1.
|
57
|
-
halib-0.1.
|
58
|
-
halib-0.1.
|
59
|
-
halib-0.1.
|
55
|
+
halib-0.1.84.dist-info/licenses/LICENSE.txt,sha256=qZssdna4aETiR8znYsShUjidu-U4jUT9Q-EWNlZ9yBQ,1100
|
56
|
+
halib-0.1.84.dist-info/METADATA,sha256=7rx1qsP50k17bZ_K9ffKdpBR3fLUtKpmYu-Q-xZTf8Q,5864
|
57
|
+
halib-0.1.84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
58
|
+
halib-0.1.84.dist-info/top_level.txt,sha256=7AD6PLaQTreE0Fn44mdZsoHBe_Zdd7GUmjsWPyQ7I-k,6
|
59
|
+
halib-0.1.84.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|