nnsight 0.5.0.dev2__tar.gz → 0.5.0.dev4__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.
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/PKG-INFO +1 -1
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/_c/py_mount.c +14 -29
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/envoy.py +4 -1
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/interleaver.py +3 -1
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/base.py +5 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/tracer.py +2 -1
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight.egg-info/PKG-INFO +1 -1
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/.github/workflows/publish.yml +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/.github/workflows/python-app.yml +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/.gitignore +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/CHANGELOG.md +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/CODE_OF_CONDUCT.md +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/LICENSE +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/NNsight_Walkthrough.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/NNsight_v0_3_guide.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/NNsight_v0_4_guide.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/README.md +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/conftest.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/Makefile +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/contributing.md +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/make.bat +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/requirements.txt +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/css/custom.css +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/css/home.css +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/css/pygments.css +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/css/status.css +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/execution.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/icon.ico +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/interleaved.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/ioi.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/nnsight_logo.svg +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/activation_patching.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/attribution_patching.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/dictionary_learning.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/function_vectors.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/future_lens.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/logit_lens.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/walkthrough.webp +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/js/.DS_Store +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/js/code.js +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/js/custom.js +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_templates/layout.html +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_templates/ndif_status.html +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/about.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/conf.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation/intervention.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation/modeling.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation/schema.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation/tracing.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation/util.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/documentation.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/features.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/index.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/conditionals.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/cross_prompt.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/custom_functions.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/early_stopping.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/editing_tutorial.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/getting.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/gradients.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/iterator.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/lora_training.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/model_editing.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/modules.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/multiple_token.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/operations.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/remote_execution.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/scan_validate.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/sessions.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/setting.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/streaming.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/vllm_support.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/LoRA_tutorial.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/activation_patching.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/attribution_patching.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/boundless_DAS.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/dict_learning.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/diffusion_lens.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/images/Activation_patching-figure1.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/images/LoRA_tutorial_figure_1.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/images/LoRA_tutorial_figure_2.png +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/logit_lens.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/start_remote_access.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/tutorial_price_tagging_utils.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/walkthrough.ipynb +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/pages/home.html +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/start.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/status.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/tutorials.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/conf.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/contexts.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/intervention.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/models.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/module.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/patching.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/tracing.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/documentation/util.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/sourcelatex/index.rst +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/pyproject.toml +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/pytest.ini +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/setup.cfg +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/setup.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/_c/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/config.yaml +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/backends/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/backends/base.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/backends/editing.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/backends/execution.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/backends/remote.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/batching.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/inject.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/serialization.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/backwards.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/editing.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/globals.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/invoker.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/iterator.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/intervention/tracing/util.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/log.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/base.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/diffusion.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/language.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/mixins/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/mixins/loadable.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/mixins/meta.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/mixins/remoteable.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/model_runners/GPUModelRunner.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/model_runners/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/sampling.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/vllm.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/workers/GPUWorker.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/workers/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/schema/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/schema/config.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/schema/request.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/schema/response.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/util.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight.egg-info/SOURCES.txt +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight.egg-info/dependency_links.txt +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight.egg-info/requires.txt +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight.egg-info/top_level.txt +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/tests/__init__.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/tests/test_diffusion.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/tests/test_lm.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/tests/test_tiny.py +0 -0
- {nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/tests/test_vllm.py +0 -0
|
@@ -13,6 +13,15 @@ static MountedFunction* mounted_functions = NULL;
|
|
|
13
13
|
static int num_mounted_functions = 0;
|
|
14
14
|
static int mounted_functions_capacity = 0;
|
|
15
15
|
|
|
16
|
+
static PyObject* get_dict(PyTypeObject* type) {
|
|
17
|
+
#if PY_VERSION_HEX < 0x030C0000
|
|
18
|
+
PyObject* dict = type->tp_dict;
|
|
19
|
+
#else
|
|
20
|
+
PyObject* dict = PyType_GetDict(type);
|
|
21
|
+
#endif
|
|
22
|
+
return dict;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
// Function to mount a new function
|
|
17
26
|
static PyObject* mount_function(PyObject* self, PyObject* args) {
|
|
18
27
|
PyObject* func;
|
|
@@ -45,36 +54,11 @@ static PyObject* mount_function(PyObject* self, PyObject* args) {
|
|
|
45
54
|
mounted_functions[num_mounted_functions].func = func;
|
|
46
55
|
mounted_functions[num_mounted_functions].name = strdup(mount_point);
|
|
47
56
|
num_mounted_functions++;
|
|
48
|
-
|
|
49
|
-
// PyObject* modules = PyImport_GetModuleDict();
|
|
50
|
-
// PyObject* key, *value;
|
|
51
|
-
// Py_ssize_t pos = 0;
|
|
52
|
-
|
|
53
|
-
// while (PyDict_Next(modules, &pos, &key, &value)) {
|
|
54
|
-
// if (!PyModule_Check(value)) continue;
|
|
55
|
-
|
|
56
|
-
// PyObject* module_dict = PyModule_GetDict(value);
|
|
57
|
-
// if (!module_dict) continue;
|
|
58
|
-
|
|
59
|
-
// PyObject* item_key, *item_value;
|
|
60
|
-
// Py_ssize_t item_pos = 0;
|
|
61
|
-
// while (PyDict_Next(module_dict, &item_pos, &item_key, &item_value)) {
|
|
62
|
-
// if (PyType_Check(item_value)) {
|
|
63
|
-
// PyTypeObject* type = (PyTypeObject*)item_value;
|
|
64
|
-
|
|
65
|
-
// // Create an instance method
|
|
66
|
-
// PyObject* method = PyInstanceMethod_New(func);
|
|
67
|
-
// if (method) {
|
|
68
|
-
// PyDict_SetItemString(type->tp_dict, mount_point, method);
|
|
69
|
-
// Py_DECREF(method);
|
|
70
|
-
// PyType_Modified(type);
|
|
71
|
-
// }
|
|
72
|
-
// }
|
|
73
|
-
// }
|
|
74
|
-
// Mount only on the base object type
|
|
57
|
+
|
|
75
58
|
PyObject* method = PyInstanceMethod_New(func);
|
|
76
59
|
if (method) {
|
|
77
|
-
|
|
60
|
+
PyObject *dict = get_dict(&PyBaseObject_Type);
|
|
61
|
+
PyDict_SetItemString(dict, mount_point, method);
|
|
78
62
|
Py_DECREF(method);
|
|
79
63
|
PyType_Modified(&PyBaseObject_Type);
|
|
80
64
|
}
|
|
@@ -91,7 +75,8 @@ static PyObject* unmount_function(PyObject* self, PyObject* args) {
|
|
|
91
75
|
}
|
|
92
76
|
|
|
93
77
|
// Remove from base object type
|
|
94
|
-
|
|
78
|
+
PyObject *dict = get_dict(&PyBaseObject_Type);
|
|
79
|
+
PyDict_DelItemString(dict, mount_point);
|
|
95
80
|
PyType_Modified(&PyBaseObject_Type);
|
|
96
81
|
|
|
97
82
|
// Find and remove from our array
|
|
@@ -1023,6 +1023,7 @@ class OperationEnvoy:
|
|
|
1023
1023
|
self._interleaver = interleaver
|
|
1024
1024
|
|
|
1025
1025
|
self._source: EnvoySource = None
|
|
1026
|
+
self._fn: Callable = None
|
|
1026
1027
|
|
|
1027
1028
|
def __str__(self):
|
|
1028
1029
|
"""
|
|
@@ -1186,7 +1187,9 @@ class OperationEnvoy:
|
|
|
1186
1187
|
self.name, source, line_numbers, interleaver=self._interleaver
|
|
1187
1188
|
)
|
|
1188
1189
|
|
|
1189
|
-
self.
|
|
1190
|
+
self._fn = fn
|
|
1191
|
+
|
|
1192
|
+
self._interleaver.current.swap(f"{self.name}.fn", self._fn)
|
|
1190
1193
|
|
|
1191
1194
|
return self._source
|
|
1192
1195
|
|
|
@@ -223,9 +223,11 @@ class Interleaver:
|
|
|
223
223
|
Returns:
|
|
224
224
|
A wrapped version of the backward method
|
|
225
225
|
"""
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
|
|
228
228
|
def inner(tensor: torch.Tensor, *args, **kwargs):
|
|
229
|
+
|
|
230
|
+
from .tracing.backwards import BackwardsTracer
|
|
229
231
|
|
|
230
232
|
try:
|
|
231
233
|
|
|
@@ -335,6 +335,9 @@ class Tracer:
|
|
|
335
335
|
|
|
336
336
|
if self.info is None:
|
|
337
337
|
self.capture()
|
|
338
|
+
|
|
339
|
+
if isinstance(self.info.node.body[0], ast.Pass):
|
|
340
|
+
return self
|
|
338
341
|
|
|
339
342
|
def skip(new_frame, event, arg):
|
|
340
343
|
"""
|
|
@@ -388,6 +391,8 @@ class Tracer:
|
|
|
388
391
|
|
|
389
392
|
return True
|
|
390
393
|
|
|
394
|
+
self.backend(self)
|
|
395
|
+
|
|
391
396
|
### Serialization ###
|
|
392
397
|
|
|
393
398
|
def __getstate__(self):
|
|
@@ -419,8 +419,9 @@ class InterleavingTracer(Tracer):
|
|
|
419
419
|
"""Set the state of the tracer for deserialization."""
|
|
420
420
|
super().__setstate__(state)
|
|
421
421
|
|
|
422
|
-
|
|
422
|
+
|
|
423
423
|
self.model = state["model"]
|
|
424
|
+
self.fn = getattr(self.model, state["fn"])
|
|
424
425
|
self.tracer_var_name = state["tracer_var_name"]
|
|
425
426
|
self.mediators = state["mediators"]
|
|
426
427
|
self.batcher = state["batcher"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/function_vectors.webp
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/future_lens.webp
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/logit_lens.webp
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/_static/images/tutorials/walkthrough.webp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/custom_functions.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/early_stopping.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/editing_tutorial.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/lora_training.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/model_editing.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/multiple_token.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/remote_execution.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/features/scan_validate.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/LoRA_tutorial.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/activation_patching.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/attribution_patching.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/boundless_DAS.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/dict_learning.ipynb
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/diffusion_lens.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/docs/source/notebooks/tutorials/start_remote_access.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/model_runners/GPUModelRunner.py
RENAMED
|
File without changes
|
{nnsight-0.5.0.dev2 → nnsight-0.5.0.dev4}/src/nnsight/modeling/vllm/model_runners/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|