tensor-spectra 0.1.0__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.
Files changed (57) hide show
  1. tensor_spectra/__init__.py +12 -0
  2. tensor_spectra/__main__.py +6 -0
  3. tensor_spectra/analysis/__init__.py +31 -0
  4. tensor_spectra/analysis/crosslayer.py +702 -0
  5. tensor_spectra/analysis/orchestrator.py +270 -0
  6. tensor_spectra/analysis/subspaces.py +26 -0
  7. tensor_spectra/approx/__init__.py +28 -0
  8. tensor_spectra/approx/combined.py +112 -0
  9. tensor_spectra/approx/functional.py +234 -0
  10. tensor_spectra/approx/low_rank.py +146 -0
  11. tensor_spectra/approx/orchestrator.py +118 -0
  12. tensor_spectra/approx/quant.py +142 -0
  13. tensor_spectra/cli/__init__.py +5 -0
  14. tensor_spectra/cli/runner.py +356 -0
  15. tensor_spectra/config/__init__.py +39 -0
  16. tensor_spectra/config/io.py +98 -0
  17. tensor_spectra/config/schema.py +290 -0
  18. tensor_spectra/data/__init__.py +68 -0
  19. tensor_spectra/data/base.py +85 -0
  20. tensor_spectra/data/records.py +43 -0
  21. tensor_spectra/data/ruler.py +130 -0
  22. tensor_spectra/data/synthetic.py +131 -0
  23. tensor_spectra/extraction/__init__.py +61 -0
  24. tensor_spectra/extraction/driver.py +110 -0
  25. tensor_spectra/extraction/records.py +139 -0
  26. tensor_spectra/extraction/registry.py +155 -0
  27. tensor_spectra/extraction/targets/__init__.py +17 -0
  28. tensor_spectra/extraction/targets/attention_probs.py +155 -0
  29. tensor_spectra/extraction/targets/common.py +73 -0
  30. tensor_spectra/extraction/targets/hidden_states.py +74 -0
  31. tensor_spectra/extraction/targets/kv_cache.py +269 -0
  32. tensor_spectra/extraction/targets/mlp.py +125 -0
  33. tensor_spectra/extraction/targets/queries.py +132 -0
  34. tensor_spectra/extraction/targets/weights.py +134 -0
  35. tensor_spectra/logging/__init__.py +33 -0
  36. tensor_spectra/logging/io.py +326 -0
  37. tensor_spectra/logging/result.schema.json +117 -0
  38. tensor_spectra/logging/serialization.py +124 -0
  39. tensor_spectra/models/__init__.py +20 -0
  40. tensor_spectra/models/introspection.py +139 -0
  41. tensor_spectra/models/loading.py +102 -0
  42. tensor_spectra/repro.py +108 -0
  43. tensor_spectra/spectral/__init__.py +19 -0
  44. tensor_spectra/spectral/engine.py +341 -0
  45. tensor_spectra/spectral/options.py +61 -0
  46. tensor_spectra/spectral/randomized.py +42 -0
  47. tensor_spectra/viz/__init__.py +22 -0
  48. tensor_spectra/viz/data.py +831 -0
  49. tensor_spectra/viz/figures.py +989 -0
  50. tensor_spectra/viz/style.py +32 -0
  51. tensor_spectra/web/__init__.py +24 -0
  52. tensor_spectra/web/app.py +301 -0
  53. tensor_spectra/web/data.py +321 -0
  54. tensor_spectra-0.1.0.dist-info/METADATA +543 -0
  55. tensor_spectra-0.1.0.dist-info/RECORD +57 -0
  56. tensor_spectra-0.1.0.dist-info/WHEEL +4 -0
  57. tensorspectra/__init__.py +14 -0
@@ -0,0 +1,12 @@
1
+ """TensorSpectra: reproducible spectral analysis for Transformer tensors."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("tensor-spectra")
7
+ except PackageNotFoundError: # pragma: no cover - only used from an unpackaged source tree
8
+ __version__ = "0.1.0"
9
+
10
+ from tensor_spectra.repro import collect_environment, config_hash, set_global_seed
11
+
12
+ __all__ = ["__version__", "collect_environment", "config_hash", "set_global_seed"]
@@ -0,0 +1,6 @@
1
+ """Allow ``python -m tensor_spectra`` execution."""
2
+
3
+ from tensor_spectra.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())
@@ -0,0 +1,31 @@
1
+ """Target-independent analysis orchestration."""
2
+
3
+ from tensor_spectra.analysis.crosslayer import (
4
+ CrossLayerError,
5
+ adjusted_rand_index,
6
+ analyze_cross_layer,
7
+ cluster_similarity,
8
+ compare_matrices,
9
+ cross_target_agreement,
10
+ linear_cka,
11
+ silhouette_score,
12
+ similarity_matrix,
13
+ )
14
+ from tensor_spectra.analysis.orchestrator import AnalysisError, estimate_result_bytes, run
15
+ from tensor_spectra.analysis.subspaces import principal_angles
16
+
17
+ __all__ = [
18
+ "AnalysisError",
19
+ "CrossLayerError",
20
+ "adjusted_rand_index",
21
+ "analyze_cross_layer",
22
+ "cluster_similarity",
23
+ "compare_matrices",
24
+ "cross_target_agreement",
25
+ "estimate_result_bytes",
26
+ "linear_cka",
27
+ "principal_angles",
28
+ "run",
29
+ "silhouette_score",
30
+ "similarity_matrix",
31
+ ]