nnsight 0.2.1.dev0__py3-none-any.whl → 0.2.3.dev0__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.
- nnsight/config.yaml +1 -1
- nnsight/models/NNsightModel.py +3 -0
- nnsight/nnsight.log +23 -0
- nnsight/tracing/Proxy.py +13 -1
- {nnsight-0.2.1.dev0.dist-info → nnsight-0.2.3.dev0.dist-info}/METADATA +2 -2
- {nnsight-0.2.1.dev0.dist-info → nnsight-0.2.3.dev0.dist-info}/RECORD +9 -9
- {nnsight-0.2.1.dev0.dist-info → nnsight-0.2.3.dev0.dist-info}/LICENCE +0 -0
- {nnsight-0.2.1.dev0.dist-info → nnsight-0.2.3.dev0.dist-info}/WHEEL +0 -0
- {nnsight-0.2.1.dev0.dist-info → nnsight-0.2.3.dev0.dist-info}/top_level.txt +0 -0
nnsight/config.yaml
CHANGED
nnsight/models/NNsightModel.py
CHANGED
|
@@ -84,6 +84,7 @@ class NNsight:
|
|
|
84
84
|
*inputs: Tuple[Any],
|
|
85
85
|
trace: bool = True,
|
|
86
86
|
invoker_args: Dict[str, Any] = None,
|
|
87
|
+
scan: bool = True,
|
|
87
88
|
**kwargs: Dict[str, Any],
|
|
88
89
|
) -> Union[Runner, Any]:
|
|
89
90
|
"""Entrypoint into the tracing and interleaving functionality nnsight provides.
|
|
@@ -178,6 +179,8 @@ class NNsight:
|
|
|
178
179
|
|
|
179
180
|
invoker_args = invoker_args or {}
|
|
180
181
|
|
|
182
|
+
invoker_args["scan"] = scan
|
|
183
|
+
|
|
181
184
|
# If trace is False, we'll enter the Tracer context immediately and enter an Invoker context with the provided inputs as well.
|
|
182
185
|
# We'll also save the output of the model and return its value directly.
|
|
183
186
|
if not trace:
|
nnsight/nnsight.log
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
2024-01-12 17:37:26,264 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-hf`...
|
|
2
|
+
2024-01-12 17:37:27,194 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-hf`
|
|
3
|
+
2024-01-12 17:37:27,462 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-hf`...
|
|
4
|
+
2024-01-12 17:37:31,391 MainProcess nnsight INFO Dispatched `meta-llama/Llama-2-7b-hf`
|
|
5
|
+
2024-01-12 17:37:31,391 MainProcess nnsight INFO Running `meta-llama/Llama-2-7b-hf`...
|
|
6
|
+
2024-01-12 17:37:31,391 MainProcess nnsight INFO => SET(module_0)
|
|
7
|
+
2024-01-12 17:37:31,391 MainProcess nnsight INFO => DEL(module_0)
|
|
8
|
+
2024-01-12 17:37:31,722 MainProcess nnsight INFO Completed `meta-llama/Llama-2-7b-hf`
|
|
9
|
+
2024-01-12 17:51:16,590 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-chat-hf`...
|
|
10
|
+
2024-01-12 17:51:18,266 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-chat-hf`
|
|
11
|
+
2024-01-12 17:51:18,694 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-chat-hf`...
|
|
12
|
+
2024-01-12 20:16:46,473 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-chat-hf`...
|
|
13
|
+
2024-01-12 20:16:47,235 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-chat-hf`
|
|
14
|
+
2024-01-12 20:16:48,938 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-chat-hf`...
|
|
15
|
+
2024-01-12 20:17:11,778 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-chat-hf`...
|
|
16
|
+
2024-01-12 20:17:12,112 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-chat-hf`
|
|
17
|
+
2024-01-12 20:17:13,253 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-chat-hf`...
|
|
18
|
+
2024-01-12 20:18:39,917 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-chat-hf`...
|
|
19
|
+
2024-01-12 20:18:40,397 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-chat-hf`
|
|
20
|
+
2024-01-12 20:18:42,373 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-chat-hf`...
|
|
21
|
+
2024-01-12 20:18:56,866 MainProcess nnsight INFO Initializing `meta-llama/Llama-2-7b-hf`...
|
|
22
|
+
2024-01-12 20:18:57,324 MainProcess nnsight INFO Initialized `meta-llama/Llama-2-7b-hf`
|
|
23
|
+
2024-01-12 20:18:58,602 MainProcess nnsight INFO Dispatching `meta-llama/Llama-2-7b-hf`...
|
nnsight/tracing/Proxy.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import inspect
|
|
3
4
|
import operator
|
|
4
5
|
from typing import TYPE_CHECKING, Any, Callable, Union
|
|
5
6
|
|
|
6
|
-
import torch
|
|
7
7
|
from typing_extensions import Self
|
|
8
8
|
|
|
9
9
|
from .. import util
|
|
@@ -76,7 +76,19 @@ class Proxy:
|
|
|
76
76
|
Proxy: New call proxy.
|
|
77
77
|
"""
|
|
78
78
|
|
|
79
|
+
value = inspect._empty
|
|
80
|
+
|
|
81
|
+
# We don't want to call backward on fake tensors
|
|
82
|
+
if (
|
|
83
|
+
self.node.target is util.fetch_attr
|
|
84
|
+
and isinstance(self.node.args[1], str)
|
|
85
|
+
and self.node.args[1] == "backward"
|
|
86
|
+
):
|
|
87
|
+
|
|
88
|
+
value = None
|
|
89
|
+
|
|
79
90
|
return self.node.graph.add(
|
|
91
|
+
value=value,
|
|
80
92
|
target=Proxy.proxy_call,
|
|
81
93
|
args=[self.node] + list(args),
|
|
82
94
|
kwargs=kwargs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nnsight
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3.dev0
|
|
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
|
Project-URL: Homepage, https://github.com/JadenFiotto-Kaufman/nnsight
|
|
@@ -35,7 +35,7 @@ The `nnsight` package enables interpreting and manipulating the internals of de
|
|
|
35
35
|
|
|
36
36
|
Install this package through pip by running:
|
|
37
37
|
|
|
38
|
-
`pip install nnsight`
|
|
38
|
+
`pip install nnsight==0.2.2.dev0`
|
|
39
39
|
|
|
40
40
|
#### Examples
|
|
41
41
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
nnsight/__init__.py,sha256=0Sc5375M5G4s0z9lbg633LNUoX0u9p-cFpTuuSPhgZw,1349
|
|
2
|
-
nnsight/config.yaml,sha256=
|
|
2
|
+
nnsight/config.yaml,sha256=kLC0vVtabwrKahaEULRPaNbvRYQLOX2t-PWU_xAPsdI,75
|
|
3
3
|
nnsight/envoy.py,sha256=704y41Firxg7yyw2K2xco9n-zgvdpWzSk7ExH2Zc8rs,10470
|
|
4
4
|
nnsight/intervention.py,sha256=tG5jzCi-tCcn2M08ZlUK14kiwWCbfRVndyOmfp-gBv0,13774
|
|
5
5
|
nnsight/logger.py,sha256=IEu9U8LTZt9RrU0iiB-UPMzMGLfE4HWNJlq0BE-jpoo,584
|
|
6
|
-
nnsight/nnsight.log,sha256=
|
|
6
|
+
nnsight/nnsight.log,sha256=n7_fpwCWGRuktMfnIiZkqjX56V9gCRkARDniF7oU2Zo,2170
|
|
7
7
|
nnsight/patching.py,sha256=5QV6tdSBLI6MyFwrnCGG3CxPP2NIOew4M8h91TcKShE,2017
|
|
8
8
|
nnsight/util.py,sha256=T539C_ha98VVJAawz4F6qee1EvCh7Y2_6H-lPy1Tb1g,2900
|
|
9
9
|
nnsight/contexts/Invoker.py,sha256=5wn7GXa4bTjoj4Fh4F3yx8hO910t5Z5n7MTxa-GOpro,3379
|
|
@@ -12,7 +12,7 @@ nnsight/contexts/Tracer.py,sha256=RWVGer91wxomvwRSvuq8aLvn5tCreXZY8iZiYYd6gxM,37
|
|
|
12
12
|
nnsight/contexts/__init__.py,sha256=pFHo60jZGTTHaAhO1_pHHm2xvKcD42Q8ZsisPTOSFw8,2530
|
|
13
13
|
nnsight/models/LanguageModel.py,sha256=4-DIz9yBNDYp-3xtNVvOn_m4HhsM4eFq2wkbGhXlwPk,8834
|
|
14
14
|
nnsight/models/Mamba.py,sha256=t2gTDqtI69925o6S5YOK8VlSejeJ1VKKWhlPj_z5bvc,10113
|
|
15
|
-
nnsight/models/NNsightModel.py,sha256=
|
|
15
|
+
nnsight/models/NNsightModel.py,sha256=UpZQNTyG4rFTU3YCrCJV9FTXIDblWEYm6c_NB4_goOE,13386
|
|
16
16
|
nnsight/models/UnifiedTransformer.py,sha256=VS50wNN7-Z6IQVlHewUNBH3oAv62h6hjBh6JVgGeZ4I,4166
|
|
17
17
|
nnsight/models/__init__.py,sha256=25FXfMFudjSrprang5YGkGH6Mw1sIlZxdaUF2M3lnNg,2866
|
|
18
18
|
nnsight/models/mixins/Generation.py,sha256=dZjrJ_ZTQNpXDyf7vERnTuUZDYUkbQPENbMWtDxS6-I,1207
|
|
@@ -42,10 +42,10 @@ nnsight/toolbox/optim/lora.py,sha256=frP6FYxogD3VIbmsBC6wXtwj0vNFJw1sVINTdviTcg0
|
|
|
42
42
|
nnsight/toolbox/optim/softprompt.py,sha256=XVFILmBkP4cZdF9Vgu0Z7wkdR60MuKQaSpEdFq4M9Fg,506
|
|
43
43
|
nnsight/tracing/Graph.py,sha256=mUr5dl2mWs7JUR2yzgO3CBVXPrwOhbEoS1AZOqPRic4,9388
|
|
44
44
|
nnsight/tracing/Node.py,sha256=O9MAhbXB7hYNsgERyYLMQnKn4WAXXKHQuQQCazlDBKE,9105
|
|
45
|
-
nnsight/tracing/Proxy.py,sha256=
|
|
45
|
+
nnsight/tracing/Proxy.py,sha256=J_AjwGJmUPkC4T-lSM81OIJdRLfXkUThXAGxtXxQZt0,7710
|
|
46
46
|
nnsight/tracing/__init__.py,sha256=2TWupXaKbtLS_ZTck7r3dAMT3-NpUFHRRMn69PHEVVg,2268
|
|
47
|
-
nnsight-0.2.
|
|
48
|
-
nnsight-0.2.
|
|
49
|
-
nnsight-0.2.
|
|
50
|
-
nnsight-0.2.
|
|
51
|
-
nnsight-0.2.
|
|
47
|
+
nnsight-0.2.3.dev0.dist-info/LICENCE,sha256=OxsPB1fxlKIv7eac1dQVOVIm30wzUMl4zimr_7qAIcs,1076
|
|
48
|
+
nnsight-0.2.3.dev0.dist-info/METADATA,sha256=ZSxpT6Q6eK2zxYE1bOfWx9au5mrbOuRLNIqfpWjzq-s,14504
|
|
49
|
+
nnsight-0.2.3.dev0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
50
|
+
nnsight-0.2.3.dev0.dist-info/top_level.txt,sha256=j2zQLPuZesx4gD2zhcVWMg4wjAvKEyLz8U_qoEXKcRM,8
|
|
51
|
+
nnsight-0.2.3.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|