spatial-computing 0.19.0__tar.gz → 0.20.0__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.
- {spatial_computing-0.19.0/spatial_computing.egg-info → spatial_computing-0.20.0}/PKG-INFO +1 -1
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/pyproject.toml +1 -1
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/__init__.py +1 -1
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/workloads.py +11 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/kernel/library.py +24 -2
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/service.py +1 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/unified/providers.py +3 -1
- {spatial_computing-0.19.0 → spatial_computing-0.20.0/spatial_computing.egg-info}/PKG-INFO +1 -1
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_kernel.py +13 -2
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/LICENSE +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/README.md +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/setup.cfg +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/ai/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/ai/kvcache.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/ai/llm.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/cli.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/cost.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/detect.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/monitor.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/scheduler.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/taskqueue.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/compute/worker.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/auth.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/energy.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/ledger.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/model.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/protocol.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/core/registry.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/cuda.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/devices.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/metal.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/metal_mandel.swift +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fabric/metal_run.swift +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/agent.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/alerts.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/dashboard.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/ha.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/fleet/hub.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/holographic/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/holographic/cgh.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/holographic/model.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/intelligence/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/intelligence/predictor.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/interconnect/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/interconnect/collectives.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/interconnect/comm.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/interconnect/model.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/interconnect/tasks.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/kernel/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/kernel/dsl.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/fararray.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/pageserver.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/secure.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/shared.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/memory/tiered.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/billing.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/db.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/invoice_rules.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/mailer.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/oidc.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/pdf.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/qr.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/security.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/server.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/app.js +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/DMMono-normal-400.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/DMMono-normal-500.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/InstrumentSerif-italic-400.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/InstrumentSerif-normal-400.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/Inter-normal-400.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/Inter-normal-500.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts/Inter-normal-600.woff2 +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/fonts.css +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/index.html +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/logo.svg +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/static/style.css +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/totp.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/ubl.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/platform/vat.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/__main__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/backends/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/codegen.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/compiler.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/ir.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/lexer.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/parser.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/qir.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/runtime.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/q/sim.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/desktop/Dockerfile +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/desktop/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/desktop/start.sh +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/envs.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/inspect.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/microvm.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/planner.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/runner.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/runtime/toolchain.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/scientific/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/scientific/jobs.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/simulation/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/simulation/heat.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/simulation/nbody.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/unified/__init__.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/unified/model.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial/unified/planner.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/SOURCES.txt +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/dependency_links.txt +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/entry_points.txt +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/requires.txt +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/top_level.txt +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_auth.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_compute.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_core.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_dashboard.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_domains.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_engines.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_fabric.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_fleet.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_ha.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_hardening.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_interconnect.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_memory.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_optimizer.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_platform.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_platform2.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_q.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_qr.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_quorum.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_real_servers.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_runtime.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_sso.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_unified.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_v02.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_v03.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_v05.py +0 -0
- {spatial_computing-0.19.0 → spatial_computing-0.20.0}/tests/test_v07.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spatial-computing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Spatial Computing: open-source infrastructure efficiency toolkit. Measure, decide, prove (compute, tiered memory, runtime routing, hybrid quantum language)
|
|
5
5
|
Author: Spatial Computing contributors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "spatial-computing"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.20.0"
|
|
8
8
|
description = "Spatial Computing: open-source infrastructure efficiency toolkit. Measure, decide, prove (compute, tiered memory, runtime routing, hybrid quantum language)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -164,6 +164,15 @@ def pk_collatz_metal(n: int, limit: int) -> int:
|
|
|
164
164
|
return _pk("collatz", "metal", n, limit=limit)
|
|
165
165
|
|
|
166
166
|
|
|
167
|
+
def pk_batch_score_cpu(n: int, signals: int) -> int:
|
|
168
|
+
"""Portable kernel (spatial.kernel): a batch-scoring workload (fraud/risk/ranking-shaped), on the CPU."""
|
|
169
|
+
return _pk("batch_score", "cpu", n, signals=signals)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def pk_batch_score_metal(n: int, signals: int) -> int:
|
|
173
|
+
return _pk("batch_score", "metal", n, signals=signals)
|
|
174
|
+
|
|
175
|
+
|
|
167
176
|
def montecarlo_pi(samples: int, seed: int = 0) -> float:
|
|
168
177
|
rng = np.random.default_rng(seed)
|
|
169
178
|
inside = 0
|
|
@@ -257,6 +266,8 @@ REGISTRY = {
|
|
|
257
266
|
"pk_mandel_metal": pk_mandel_metal,
|
|
258
267
|
"pk_collatz_cpu": pk_collatz_cpu,
|
|
259
268
|
"pk_collatz_metal": pk_collatz_metal,
|
|
269
|
+
"pk_batch_score_cpu": pk_batch_score_cpu,
|
|
270
|
+
"pk_batch_score_metal": pk_batch_score_metal,
|
|
260
271
|
"heat_numpy": heat_numpy,
|
|
261
272
|
"heat_numba": heat_numba,
|
|
262
273
|
"nbody": nbody,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Kernels written in the portable language. Each runs unchanged on CPU and Metal; CUDA C
|
|
1
|
+
"""Kernels written in the portable language. Each runs unchanged on CPU and Metal; CUDA C, HIP, and Triton are generated."""
|
|
2
2
|
from .dsl import kernel
|
|
3
3
|
|
|
4
4
|
|
|
@@ -43,4 +43,26 @@ def waves(i: int, j: int, n: int, terms: int):
|
|
|
43
43
|
return int((s + 8.0) * 1000.0)
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
@kernel
|
|
47
|
+
def batch_score(i: int, j: int, n: int, signals: int):
|
|
48
|
+
"""A batch-scoring kernel: element (i, j) is one of n*n independent items, scored by combining
|
|
49
|
+
`signals` weighted features through a logistic sum — the same shape as scoring a transaction for
|
|
50
|
+
fraud/credit risk, ranking a search or ad result, flagging an anomaly, or filtering content, whichever
|
|
51
|
+
software already does that scoring in a batch or a stream. The features and weights here are SYNTHETIC
|
|
52
|
+
(no real data, no trained model): this demonstrates that the planner places and measures a batch-scoring
|
|
53
|
+
job exactly like it places Mandelbrot or Collatz, not a validated scoring model for any one domain.
|
|
54
|
+
Returns the score quantised to [0, 10000] (hundredths of a percent)."""
|
|
55
|
+
idx = i * n + j
|
|
56
|
+
x1 = float(idx % 2000) / 20.0 - 50.0
|
|
57
|
+
x2 = float(i) / float(n) - 0.5
|
|
58
|
+
z = 0.0
|
|
59
|
+
k = 0
|
|
60
|
+
while k < signals:
|
|
61
|
+
w = sin(float(k + 1) * 0.37) * 1.3
|
|
62
|
+
z += w * (x1 / (float(k) + 1.0) + x2)
|
|
63
|
+
k += 1
|
|
64
|
+
p = 1.0 / (1.0 + exp(-z))
|
|
65
|
+
return int(p * 10000.0)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
LIBRARY = {"mandelbrot": mandelbrot, "collatz": collatz, "waves": waves, "batch_score": batch_score}
|
|
@@ -31,6 +31,7 @@ CATALOG = {
|
|
|
31
31
|
"montecarlo_pi": dict(title="Monte Carlo pi", doc="Estimate pi by random sampling (CPU-bound, embarrassingly parallel).", params={"samples": (1_000_000, 1000, 50_000_000)}),
|
|
32
32
|
"mandel_numba_parallel": dict(title="Mandelbrot (multi-core)", doc="Iteration counts of the Mandelbrot set on a grid, Numba on all cores.", params={"n": (600, 16, 3000), "iters": (200, 10, 2000)}),
|
|
33
33
|
"pk_mandel_cpu": dict(title="Portable kernel: Mandelbrot", doc="The same kernel source that also runs on a Metal GPU, on the CPU.", params={"n": (512, 16, 2048), "iters": (200, 10, 2000)}),
|
|
34
|
+
"pk_batch_score_cpu": dict(title="Portable kernel: batch scoring", doc="Fraud/risk/ranking/anomaly-shaped batch scoring (synthetic signals, no real model) on the CPU.", params={"n": (512, 16, 2048), "signals": (16, 1, 200)}),
|
|
34
35
|
"matmul": dict(title="Matrix multiply", doc="Dense float64 matrix product of size n.", params={"n": (600, 16, 1500)}),
|
|
35
36
|
"heat_numba": dict(title="Heat diffusion", doc="2-D heat diffusion from a hot square (simulation engine, Numba).", params={"n": (200, 16, 800), "steps": (500, 1, 5000)}),
|
|
36
37
|
"nbody": dict(title="N-body", doc="Leapfrog N-body integration; returns the relative energy drift.", params={"bodies": (100, 2, 300), "steps": (400, 1, 2000)}),
|
|
@@ -36,6 +36,8 @@ FAMILIES = {
|
|
|
36
36
|
# but has no run path here, so it is not offered as an option.
|
|
37
37
|
"pk_mandel": dict(variants={"cpu": "pk_mandel_cpu", "gpu_metal": "pk_mandel_metal"}, scale="n", exp=2.0, min=8, exact=False, tol=1e-3),
|
|
38
38
|
"pk_collatz": dict(variants={"cpu": "pk_collatz_cpu", "gpu_metal": "pk_collatz_metal"}, scale="n", exp=2.0, min=8, exact=True),
|
|
39
|
+
# batch scoring (fraud/risk/ranking/anomaly-shaped): same "one job, several devices" idea, a different work shape
|
|
40
|
+
"pk_batch_score": dict(variants={"cpu": "pk_batch_score_cpu", "gpu_metal": "pk_batch_score_metal"}, scale="n", exp=2.0, min=8, exact=False, tol=1e-3),
|
|
39
41
|
"heat": dict(variants={"numpy": "heat_numpy", "numba": "heat_numba"}, scale="steps", exp=1.0, min=2, exact=False),
|
|
40
42
|
"nbody": dict(variants={"cpu": "nbody"}, scale="steps", exp=1.0, min=2, exact=False),
|
|
41
43
|
"hologram": dict(variants={"cpu": "hologram_peak"}, scale="n", exp=2.0, min=32, exact=True),
|
|
@@ -50,7 +52,7 @@ def _same(a, b, exact: bool, tol: float = 1e-6) -> bool:
|
|
|
50
52
|
|
|
51
53
|
def _variant_available(workload: str) -> str | None:
|
|
52
54
|
"""None if the variant can run here, else why not."""
|
|
53
|
-
if workload in ("mandel_f32_metal", "pk_mandel_metal", "pk_collatz_metal"):
|
|
55
|
+
if workload in ("mandel_f32_metal", "pk_mandel_metal", "pk_collatz_metal", "pk_batch_score_metal"):
|
|
54
56
|
from ..fabric import metal
|
|
55
57
|
return None if metal.available() else "no Metal GPU (macOS with swiftc is required)"
|
|
56
58
|
if workload == "mandel_f32_cuda":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spatial-computing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Spatial Computing: open-source infrastructure efficiency toolkit. Measure, decide, prove (compute, tiered memory, runtime routing, hybrid quantum language)
|
|
5
5
|
Author: Spatial Computing contributors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -4,7 +4,7 @@ import pytest
|
|
|
4
4
|
|
|
5
5
|
from spatial.fabric import metal
|
|
6
6
|
from spatial.kernel import KernelError, kernel
|
|
7
|
-
from spatial.kernel.library import LIBRARY, collatz, mandelbrot, waves
|
|
7
|
+
from spatial.kernel.library import LIBRARY, batch_score, collatz, mandelbrot, waves
|
|
8
8
|
|
|
9
9
|
needs_metal = pytest.mark.skipif(not metal.available(), reason="no Metal")
|
|
10
10
|
|
|
@@ -46,6 +46,8 @@ def test_float_kernels_agree_within_tolerance():
|
|
|
46
46
|
assert np.mean(a != b) < 0.01 # float32 chaos at the set's boundary: a few pixels may differ
|
|
47
47
|
w1, w2 = waves.run("cpu", 64, terms=8), waves.run("metal", 64, terms=8)
|
|
48
48
|
assert np.abs(w1.astype(np.int64) - w2.astype(np.int64)).max() <= 3 # GPU sin/cos differ in the last bits
|
|
49
|
+
r1, r2 = batch_score.run("cpu", 64, signals=16), batch_score.run("metal", 64, signals=16)
|
|
50
|
+
assert np.abs(r1.astype(np.int64) - r2.astype(np.int64)).max() <= 5
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
def test_unsupported_constructs_are_refused():
|
|
@@ -100,7 +102,16 @@ def test_triton_source_handles_ints_floats_and_control_flow_syntactically():
|
|
|
100
102
|
|
|
101
103
|
|
|
102
104
|
def test_library_complete():
|
|
103
|
-
assert set(LIBRARY) == {"mandelbrot", "collatz", "waves"}
|
|
105
|
+
assert set(LIBRARY) == {"mandelbrot", "collatz", "waves", "batch_score"}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_batch_score_is_a_plausible_probability_and_matches_cpu_metal():
|
|
109
|
+
out = batch_score.run("cpu", 64, signals=16)
|
|
110
|
+
assert out.min() >= 0 and out.max() <= 10000 and out.std() > 0 # quantised probability, not a constant
|
|
111
|
+
tl = batch_score.to_triton()
|
|
112
|
+
assert "@triton.jit" in tl and "while" in tl and "tl.exp" in tl
|
|
113
|
+
compile(tl, "<triton batch_score>", "exec")
|
|
114
|
+
|
|
104
115
|
|
|
105
116
|
|
|
106
117
|
def test_planner_offers_portable_kernel_families():
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/requires.txt
RENAMED
|
File without changes
|
{spatial_computing-0.19.0 → spatial_computing-0.20.0}/spatial_computing.egg-info/top_level.txt
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
|