ob-metaflow-extensions 1.1.96__py2.py3-none-any.whl → 1.1.97__py2.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 ob-metaflow-extensions might be problematic. Click here for more details.

@@ -317,6 +317,7 @@ STEP_DECORATORS_DESC = [
317
317
  ".fast_bakery.fast_bakery_decorator.InternalFastBakeryDecorator",
318
318
  ),
319
319
  ("snowpark", ".snowpark.snowpark_decorator.SnowparkDecorator"),
320
+ ("tensorboard", ".tensorboard.TensorboardDecorator"),
320
321
  ]
321
322
  FLOW_DECORATORS_DESC = [("nim", ".nim.NimDecorator")]
322
323
  TOGGLE_STEP_DECORATOR = [
@@ -0,0 +1,50 @@
1
+ import functools
2
+ from metaflow.decorators import StepDecorator
3
+
4
+
5
+ class TensorboardDecorator(StepDecorator):
6
+ name = "tensorboard"
7
+ defaults = {}
8
+
9
+ def task_decorate(
10
+ self, step_func, flow, graph, retry_count, max_user_code_retries, ubf_context
11
+ ):
12
+ @functools.wraps(step_func)
13
+ def tb_wrapper():
14
+ import sys, os
15
+ from metaflow import metaflow_config, current
16
+
17
+ try:
18
+ from torch.utils.tensorboard import SummaryWriter
19
+ except:
20
+ print(
21
+ "[@tensorboard] Torch and tensorboard not found - logging disabled!",
22
+ file=sys.stderr,
23
+ )
24
+ step_func()
25
+ else:
26
+ tb_root = os.path.join(metaflow_config.DATATOOLS_S3ROOT, "tb")
27
+ pathspec = current.pathspec
28
+ try:
29
+ log_dir = os.path.join(tb_root, current.project_flow_name, pathspec)
30
+ except:
31
+ log_dir = os.path.join(tb_root, pathspec)
32
+ comps = log_dir[len(tb_root) + 1 :].split("/")
33
+ run_level = "/".join(comps[:-2])
34
+ flow_level = "/".join(comps[:-3])
35
+
36
+ print("[@tensorboard] -- INSPECTING RESULTS")
37
+ print(
38
+ "[@tensorboard] -- Execute one of these commands on your workstation:"
39
+ )
40
+ print(f"[@tensorboard] Compare tasks of this run: obtb {run_level}")
41
+ print(f"[@tensorboard] Compare across runs: obtb {flow_level}")
42
+ writer = SummaryWriter(log_dir=log_dir)
43
+ setattr(flow, "obtb", writer)
44
+ try:
45
+ step_func()
46
+ finally:
47
+ writer.flush()
48
+ delattr(flow, "obtb")
49
+
50
+ return tb_wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-metaflow-extensions
3
- Version: 1.1.96
3
+ Version: 1.1.97
4
4
  Summary: Outerbounds Platform Extensions for Metaflow
5
5
  Author: Outerbounds, Inc.
6
6
  License: Commercial
@@ -1,7 +1,7 @@
1
1
  metaflow_extensions/outerbounds/__init__.py,sha256=TRGvIUMjkfneWtYUFSWoubu_Kf2ekAL4WLbV3IxOj9k,499
2
2
  metaflow_extensions/outerbounds/remote_config.py,sha256=Zpfpjgz68_ZgxlXezjzlsDLo4840rkWuZgwDB_5H57U,4059
3
3
  metaflow_extensions/outerbounds/config/__init__.py,sha256=JsQGRuGFz28fQWjUvxUgR8EKBLGRdLUIk_buPLJplJY,1225
4
- metaflow_extensions/outerbounds/plugins/__init__.py,sha256=WwvFcN5kserbPwhrE4hXprnXzJxonEPT0Mlik2kmGMA,12406
4
+ metaflow_extensions/outerbounds/plugins/__init__.py,sha256=7-n1jwyvdNkMo3oU9CMF-YABr6jWRqlI-g8u9LexVR0,12464
5
5
  metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=1v2GBqoMBxp5E7Lejz139w-jxJtPnLDvvHXP0HhEIHI,2361
6
6
  metaflow_extensions/outerbounds/plugins/perimeters.py,sha256=QXh3SFP7GQbS-RAIxUOPbhPzQ7KDFVxZkTdKqFKgXjI,2697
7
7
  metaflow_extensions/outerbounds/plugins/fast_bakery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -26,6 +26,7 @@ metaflow_extensions/outerbounds/plugins/snowpark/snowpark_decorator.py,sha256=3A
26
26
  metaflow_extensions/outerbounds/plugins/snowpark/snowpark_exceptions.py,sha256=FTfYlJu-sn9DkPOs2R1V1ChWb1vZthOgeq0BZdT1ucY,296
27
27
  metaflow_extensions/outerbounds/plugins/snowpark/snowpark_job.py,sha256=d_5UhXqZ_12rCvatH1capPQZYGLx1FVqq_rtW65OXyk,6874
28
28
  metaflow_extensions/outerbounds/plugins/snowpark/snowpark_service_spec.py,sha256=AI_kcm1hZV3JRxJkookcH6twiGnAYjk9Dx-MeoYz60Y,8511
29
+ metaflow_extensions/outerbounds/plugins/tensorboard/__init__.py,sha256=9lUM4Cqi5RjrHBRfG6AQMRz8-R96eZC8Ih0KD2lv22Y,1858
29
30
  metaflow_extensions/outerbounds/profilers/__init__.py,sha256=wa_jhnCBr82TBxoS0e8b6_6sLyZX0fdHicuGJZNTqKw,29
30
31
  metaflow_extensions/outerbounds/profilers/gpu.py,sha256=a5YZAepujuP0uDqG9UpXBlZS3wjUt4Yv8CjybXqeT2c,24342
31
32
  metaflow_extensions/outerbounds/toplevel/__init__.py,sha256=qWUJSv_r5hXJ7jV_On4nEasKIfUCm6_UjkjXWA_A1Ts,90
@@ -33,7 +34,7 @@ metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,
33
34
  metaflow_extensions/outerbounds/toplevel/plugins/azure/__init__.py,sha256=WUuhz2YQfI4fz7nIcipwwWq781eaoHEk7n4GAn1npDg,63
34
35
  metaflow_extensions/outerbounds/toplevel/plugins/gcp/__init__.py,sha256=BbZiaH3uILlEZ6ntBLKeNyqn3If8nIXZFq_Apd7Dhco,70
35
36
  metaflow_extensions/outerbounds/toplevel/plugins/kubernetes/__init__.py,sha256=5zG8gShSj8m7rgF4xgWBZFuY3GDP5n1T0ktjRpGJLHA,69
36
- ob_metaflow_extensions-1.1.96.dist-info/METADATA,sha256=TaJnt4v7k41yQoFx4x2o5lVe1YYO5Z6xFWAKMOtsJw4,520
37
- ob_metaflow_extensions-1.1.96.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
38
- ob_metaflow_extensions-1.1.96.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
39
- ob_metaflow_extensions-1.1.96.dist-info/RECORD,,
37
+ ob_metaflow_extensions-1.1.97.dist-info/METADATA,sha256=DuTSqhJsXs0n1kfud4ayP92V0uos7h7ZYsNFc8eZidQ,520
38
+ ob_metaflow_extensions-1.1.97.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
39
+ ob_metaflow_extensions-1.1.97.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
40
+ ob_metaflow_extensions-1.1.97.dist-info/RECORD,,