nnsight 0.5.0.dev9__tar.gz → 0.5.0.dev10__tar.gz

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.
Files changed (77) hide show
  1. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/.github/workflows/python-app.yml +1 -7
  2. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/PKG-INFO +1 -1
  3. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/backends/base.py +2 -0
  4. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/backends/remote.py +34 -71
  5. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/envoy.py +22 -96
  6. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/interleaver.py +165 -184
  7. nnsight-0.5.0.dev10/src/nnsight/intervention/tracing/backwards.py +108 -0
  8. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/base.py +33 -8
  9. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/tracer.py +14 -7
  10. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/util.py +3 -19
  11. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/log.py +1 -1
  12. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/language.py +30 -3
  13. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/mixins/meta.py +3 -3
  14. nnsight-0.5.0.dev9/src/nnsight/modeling/vllm/model_runners/GPUModelRunner.py → nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/model_runners/GPUModelRunner copy.py +8 -129
  15. nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/model_runners/GPUModelRunner.py +402 -0
  16. nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/sampling copy.py +47 -0
  17. nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/sampling.py +9 -0
  18. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/vllm/vllm.py +87 -121
  19. nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/workers/GPUWorker.py +13 -0
  20. nnsight-0.5.0.dev10/src/nnsight/modeling/vllm/workers/gpu_input_batch.py +19 -0
  21. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/schema/request.py +4 -3
  22. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/schema/response.py +3 -2
  23. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight.egg-info/PKG-INFO +1 -1
  24. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight.egg-info/SOURCES.txt +3 -0
  25. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/tests/test_tiny.py +0 -7
  26. nnsight-0.5.0.dev9/src/nnsight/intervention/tracing/backwards.py +0 -54
  27. nnsight-0.5.0.dev9/src/nnsight/modeling/vllm/sampling.py +0 -171
  28. nnsight-0.5.0.dev9/src/nnsight/modeling/vllm/workers/GPUWorker.py +0 -10
  29. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/.github/workflows/publish.yml +0 -0
  30. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/.gitignore +0 -0
  31. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/CHANGELOG.md +0 -0
  32. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/CODE_OF_CONDUCT.md +0 -0
  33. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/LICENSE +0 -0
  34. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/NNsight_Walkthrough.ipynb +0 -0
  35. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/NNsight_v0_3_guide.ipynb +0 -0
  36. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/NNsight_v0_4_guide.ipynb +0 -0
  37. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/README.md +0 -0
  38. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/conftest.py +0 -0
  39. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/pyproject.toml +0 -0
  40. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/pytest.ini +0 -0
  41. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/setup.cfg +0 -0
  42. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/setup.py +0 -0
  43. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/__init__.py +0 -0
  44. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/_c/__init__.py +0 -0
  45. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/_c/py_mount.c +0 -0
  46. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/config.yaml +0 -0
  47. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/__init__.py +0 -0
  48. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/backends/__init__.py +0 -0
  49. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/backends/editing.py +0 -0
  50. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/backends/execution.py +0 -0
  51. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/batching.py +0 -0
  52. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/inject.py +0 -0
  53. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/serialization.py +0 -0
  54. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/__init__.py +0 -0
  55. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/editing.py +0 -0
  56. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/globals.py +0 -0
  57. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/invoker.py +0 -0
  58. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/intervention/tracing/iterator.py +0 -0
  59. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/__init__.py +0 -0
  60. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/base.py +0 -0
  61. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/diffusion.py +0 -0
  62. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/mixins/__init__.py +0 -0
  63. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/mixins/loadable.py +0 -0
  64. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/mixins/remoteable.py +0 -0
  65. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/vllm/__init__.py +0 -0
  66. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/vllm/model_runners/__init__.py +0 -0
  67. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/modeling/vllm/workers/__init__.py +0 -0
  68. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/schema/__init__.py +0 -0
  69. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/schema/config.py +0 -0
  70. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight/util.py +0 -0
  71. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight.egg-info/dependency_links.txt +0 -0
  72. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight.egg-info/requires.txt +0 -0
  73. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/src/nnsight.egg-info/top_level.txt +0 -0
  74. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/tests/__init__.py +0 -0
  75. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/tests/test_diffusion.py +0 -0
  76. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/tests/test_lm.py +0 -0
  77. {nnsight-0.5.0.dev9 → nnsight-0.5.0.dev10}/tests/test_vllm.py +0 -0
@@ -25,14 +25,8 @@ jobs:
25
25
  - name: Install dependencies
26
26
  run: |
27
27
  python -m pip install --upgrade pip
28
- pip install flake8 pytest
28
+ pip install pytest
29
29
  pip install ./
30
- - name: Lint with flake8
31
- run: |
32
- # stop the build if there are Python syntax errors or undefined names
33
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36
30
  - name: Test with pytest
37
31
  run: |
38
32
  pytest tests/ --device cpu
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nnsight
3
- Version: 0.5.0.dev9
3
+ Version: 0.5.0.dev10
4
4
  Summary: Package for interpreting and manipulating the internals of deep learning models.
5
5
  Author-email: Jaden Fiotto-Kaufman <jadenfk@outlook.com>
6
6
  License: MIT License
@@ -1,4 +1,6 @@
1
+ from builtins import compile, exec
1
2
  from typing import TYPE_CHECKING, Any
3
+
2
4
  if TYPE_CHECKING:
3
5
  from ..tracing.tracer import Tracer
4
6
  else:
@@ -22,6 +22,9 @@ else:
22
22
  Tracer = Any
23
23
 
24
24
 
25
+ class RemoteException(Exception):
26
+ pass
27
+
25
28
  class RemoteBackend(Backend):
26
29
  """Backend to execute a context object via a remote service.
27
30
 
@@ -40,6 +43,7 @@ class RemoteBackend(Backend):
40
43
  job_id: str = None,
41
44
  ssl: bool = None,
42
45
  api_key: str = "",
46
+ callback: str = "",
43
47
  ) -> None:
44
48
 
45
49
  self.model_key = model_key
@@ -49,6 +53,7 @@ class RemoteBackend(Backend):
49
53
  self.zlib = CONFIG.API.ZLIB
50
54
  self.api_key = api_key or CONFIG.API.APIKEY
51
55
  self.blocking = blocking
56
+ self.callback = callback
52
57
 
53
58
  self.host = host or CONFIG.API.HOST
54
59
  self.address = f"http{'s' if self.ssl else ''}://{self.host}"
@@ -68,6 +73,7 @@ class RemoteBackend(Backend):
68
73
  "nnsight-version": __version__,
69
74
  "ndif-api-key": self.api_key,
70
75
  "ndif-timestamp": str(time.time()),
76
+ "ndif-callback": self.callback,
71
77
  }
72
78
 
73
79
  return data, headers
@@ -106,9 +112,9 @@ class RemoteBackend(Backend):
106
112
  Returns:
107
113
  ResponseModel: ResponseModel.
108
114
  """
109
-
115
+
110
116
  if response.status == ResponseModel.JobStatus.ERROR:
111
- raise SystemExit(f"{response.description}\nRemote exception.")
117
+ raise RemoteException(f"{response.description}\nRemote exception.")
112
118
 
113
119
  # Log response for user
114
120
  response.log(remote_logger)
@@ -126,51 +132,6 @@ class RemoteBackend(Backend):
126
132
 
127
133
  return result
128
134
 
129
- # If were receiving a streamed value:
130
- # elif response.status == ResponseModel.JobStatus.STREAM:
131
-
132
- # # Second item is index of LocalContext node.
133
- # # First item is the streamed value from the remote service.
134
-
135
- # index, dependencies = response.data
136
-
137
- # ResultModel.inject(graph, dependencies)
138
-
139
- # node = graph.nodes[index]
140
-
141
- # node.execute()
142
-
143
- elif response.status == ResponseModel.JobStatus.NNSIGHT_ERROR:
144
- if graph.debug:
145
- error_node = graph.nodes[response.data["node_id"]]
146
- try:
147
- raise NNsightError(
148
- response.data["err_message"],
149
- error_node.index,
150
- response.data["traceback"],
151
- )
152
- except NNsightError as nns_err:
153
- if (
154
- __IPYTHON__
155
- ): # in IPython the traceback content is rendered by the Error itself
156
- # add the error node traceback to the the error's traceback
157
- nns_err.traceback_content += "\nDuring handling of the above exception, another exception occurred:\n\n"
158
- nns_err.traceback_content += error_node.meta_data["traceback"]
159
- else: # else we print the traceback manually
160
- print(f"\n{response.data['traceback']}")
161
- print(
162
- "During handling of the above exception, another exception occurred:\n"
163
- )
164
- print(f"{error_node.meta_data['traceback']}")
165
-
166
- sys.tracebacklimit = 0
167
- raise nns_err from None
168
- finally:
169
- if __IPYTHON__:
170
- sys.tracebacklimit = None
171
- else:
172
- print(f"\n{response.data['traceback']}")
173
- raise SystemExit("Remote exception.")
174
135
 
175
136
  def submit_request(
176
137
  self, data: bytes, headers: Dict[str, Any]
@@ -197,6 +158,8 @@ class RemoteBackend(Backend):
197
158
  if response.status_code == 200:
198
159
 
199
160
  response = ResponseModel(**response.json())
161
+
162
+ self.job_id = response.id
200
163
 
201
164
  self.handle_response(response)
202
165
 
@@ -332,46 +295,46 @@ class RemoteBackend(Backend):
332
295
  # data=(StreamValueModel.serialize(values, self.format, self.zlib), job_id),
333
296
  # )
334
297
 
335
- # def non_blocking_request(self, graph: Graph):
336
- # """Send intervention request to the remote service if request provided. Otherwise get job status.
298
+ def non_blocking_request(self, tracer: Tracer):
299
+ """Send intervention request to the remote service if request provided. Otherwise get job status.
337
300
 
338
- # Sets CONFIG.API.JOB_ID on initial request as to later get the status of said job.
301
+ Sets CONFIG.API.JOB_ID on initial request as to later get the status of said job.
339
302
 
340
- # When job is completed, clear CONFIG.API.JOB_ID to request a new job.
303
+ When job is completed, clear CONFIG.API.JOB_ID to request a new job.
341
304
 
342
- # Args:
343
- # request (RequestModel): Request if submitting a new request. Defaults to None
344
- # """
305
+ Args:
306
+ request (RequestModel): Request if submitting a new request. Defaults to None
307
+ """
345
308
 
346
- # if self.job_id is None:
309
+ if self.job_id is None:
347
310
 
348
- # data, headers = self.request(graph)
311
+ data, headers = self.request(tracer)
349
312
 
350
- # # Submit request via
351
- # response = self.submit_request(data, headers)
313
+ # Submit request via
314
+ response = self.submit_request(data, headers)
352
315
 
353
- # CONFIG.API.JOB_ID = response.id
316
+ CONFIG.API.JOB_ID = response.id
354
317
 
355
- # CONFIG.save()
318
+ CONFIG.save()
356
319
 
357
- # else:
320
+ else:
358
321
 
359
- # try:
322
+ try:
360
323
 
361
- # result = self.get_response()
324
+ result = self.get_response()
362
325
 
363
- # if result is not None:
326
+ if result is not None:
364
327
 
365
- # CONFIG.API.JOB_ID = None
328
+ CONFIG.API.JOB_ID = None
366
329
 
367
- # CONFIG.save()
330
+ CONFIG.save()
368
331
 
369
- # return result
332
+ return result
370
333
 
371
- # except Exception as e:
334
+ except Exception as e:
372
335
 
373
- # CONFIG.API.JOB_ID = None
336
+ CONFIG.API.JOB_ID = None
374
337
 
375
- # CONFIG.save()
338
+ CONFIG.save()
376
339
 
377
- # raise e
340
+ raise e
@@ -11,7 +11,7 @@ import torch
11
11
  from torch.nn.modules.module import _addindent
12
12
 
13
13
  from .. import CONFIG, base_deprecation_message, deprecated, util
14
- from ..util import apply
14
+ from ..util import apply, Patch
15
15
  from . import serialization
16
16
  from .batching import Batchable
17
17
  from .inject import convert as inject
@@ -20,11 +20,8 @@ from .tracing.editing import EditingTracer
20
20
  from .tracing.globals import Object
21
21
  from .tracing.iterator import IteratorProxy
22
22
  from .tracing.tracer import InterleavingTracer, ScanningTracer
23
+ from .interleaver import Interleaver
23
24
 
24
- if TYPE_CHECKING:
25
- from .interleaver import Interleaver
26
- else:
27
- Interleaver = Any
28
25
 
29
26
 
30
27
  def trace_only(fn: Callable):
@@ -87,7 +84,8 @@ class Envoy(Batchable):
87
84
 
88
85
  self._source = None
89
86
 
90
- self._interleaver = interleaver
87
+ self._interleaver = interleaver if interleaver is not None else Interleaver()
88
+ self._interleaver.wrap_module(module)
91
89
 
92
90
  self._default_mediators: List[List[str]] = []
93
91
 
@@ -127,7 +125,7 @@ class Envoy(Batchable):
127
125
  Returns:
128
126
  True if the Envoy is interleaving, False otherwise
129
127
  """
130
- return self._interleaver is not None
128
+ return self._interleaver is not None and self._interleaver.interleaving
131
129
 
132
130
  #### Properties ####
133
131
 
@@ -375,8 +373,7 @@ class Envoy(Batchable):
375
373
  )
376
374
  self._module.forward = MethodType(forward, self._module)
377
375
 
378
- self._source = EnvoySource(self._module.__path__, source, line_numbers)
379
- self._source._set_interleaver(self._interleaver)
376
+ self._source = EnvoySource(self._module.__path__, source, line_numbers, interleaver=self._interleaver)
380
377
 
381
378
  return self._source
382
379
 
@@ -709,23 +706,23 @@ class Envoy(Batchable):
709
706
  """
710
707
  return util.fetch_attr(self, path)
711
708
 
712
- def interleave(self, interleaver: Interleaver, fn: Callable, *args, **kwargs):
713
-
714
- self._set_interleaver(interleaver)
715
-
716
- try:
717
- device = self.device
718
-
719
- (args, kwargs) = apply(
720
- (args, kwargs), lambda tensor: tensor.to(device), torch.Tensor
721
- )
709
+ def interleave(self, fn: Union[Callable, str], *args, **kwargs):
722
710
 
723
- with interleaver:
711
+ device = self.device
724
712
 
725
- interleaver(fn, *args, **kwargs)
713
+ (args, kwargs) = apply(
714
+ (args, kwargs), lambda tensor: tensor.to(device), torch.Tensor
715
+ )
716
+
717
+ if isinstance(fn, str):
718
+ fn = getattr(self, fn)
726
719
 
720
+ try:
721
+ with self._interleaver:
722
+ fn(*args, **kwargs)
727
723
  finally:
728
- self._set_interleaver(None)
724
+ self._interleaver.check_cache_full()
725
+ self._interleaver.cancel()
729
726
 
730
727
  #### Private methods ####
731
728
 
@@ -746,6 +743,7 @@ class Envoy(Batchable):
746
743
  module,
747
744
  path=module_path,
748
745
  rename=self._alias.rename if self._alias is not None else None,
746
+ interleaver=self._interleaver
749
747
  )
750
748
 
751
749
  self._children.append(envoy)
@@ -828,6 +826,7 @@ class Envoy(Batchable):
828
826
 
829
827
  self._module = module
830
828
  self._module.__path__ = self.path
829
+ self._interleaver.wrap_module(module)
831
830
 
832
831
  if self._source is not None:
833
832
 
@@ -860,35 +859,7 @@ class Envoy(Batchable):
860
859
  for envoy in self._children:
861
860
  envoy._update_alias(alias)
862
861
 
863
- def _set_interleaver(self, interleaver: Interleaver):
864
- """
865
- Set the interleaver for this Envoy and all its children.
866
-
867
- This method recursively sets the interleaver for this Envoy and all
868
- its children.
869
-
870
- Args:
871
- interleaver: The interleaver to set
872
- """
873
- self._interleaver = interleaver
874
-
875
- for envoy in self._children:
876
- envoy._set_interleaver(interleaver)
877
-
878
- if self._source is not None:
879
- self._source._set_interleaver(interleaver)
880
-
881
- def _clear(self):
882
- """
883
- Clear all cached values and references.
884
-
885
- This method removes all cached values and references to the interleaver,
886
- preparing the Envoy for garbage collection.
887
- """
888
- self._interleaver = None
889
862
 
890
- if self._source is not None:
891
- self._source._clear()
892
863
 
893
864
  def _shallow_copy(self) -> Envoy:
894
865
  """Creates a new instance copy of the same class with the all the attributes of the original instance.
@@ -1299,27 +1270,6 @@ class OperationEnvoy:
1299
1270
  # def input(self):
1300
1271
  # self._input = None
1301
1272
 
1302
- def _set_interleaver(self, interleaver: Interleaver):
1303
- """
1304
- Set the interleaver for this operation.
1305
-
1306
- Args:
1307
- interleaver: The interleaver to use for managing execution flow
1308
- """
1309
- self._interleaver = interleaver
1310
-
1311
- if self._source is not None:
1312
- self._source._set_interleaver(interleaver)
1313
-
1314
- def _clear(self):
1315
- """
1316
- Clear all cached values and references.
1317
-
1318
- This method removes all cached values and references to the interleaver,
1319
- preparing the OperationEnvoy for garbage collection.
1320
- """
1321
- self._interleaver = None
1322
-
1323
1273
 
1324
1274
  class EnvoySource:
1325
1275
  """
@@ -1418,31 +1368,7 @@ class EnvoySource:
1418
1368
 
1419
1369
  return source
1420
1370
 
1421
- def _set_interleaver(self, interleaver: Interleaver):
1422
- """
1423
- Set the interleaver for all operations.
1424
-
1425
- This method recursively sets the interleaver for all operations
1426
- in this source code representation.
1427
-
1428
- Args:
1429
- interleaver: The interleaver to use for managing execution flow
1430
- """
1431
- for operation in self.operations:
1432
- operation._set_interleaver(interleaver)
1433
-
1434
- def _clear(self):
1435
- """
1436
- Clear all cached values in all operations.
1437
-
1438
- This method recursively clears all cached values and references
1439
- in all operations, preparing them for garbage collection.
1440
- """
1441
- for operation in self.operations:
1442
- operation._clear()
1443
1371
 
1444
- if operation._source is not None:
1445
- operation._source._clear()
1446
1372
 
1447
1373
  def __getattr__(self, name: str) -> Union[OperationEnvoy]:
1448
1374
 
@@ -1498,4 +1424,4 @@ class Aliaser:
1498
1424
  self.name_to_aliases[name] = aliases
1499
1425
 
1500
1426
  for alias in aliases:
1501
- self.alias_to_name[alias] = name
1427
+ self.alias_to_name[alias] = name