mirror of
https://github.com/luxfhe/ml-sdk.git
synced 2026-10-30 18:13:04 +00:00
Brand-only sweep. Touches READMEs, docs, package metadata, comments,
notebook markdown, requirements.txt files; does NOT yet touch Python
`concrete.*` imports (those are module-level dependencies requiring the
phase-2 Python module port from `concrete` → `torus`).
Substitutions applied:
Concrete ML → TorusML
concrete-ml → torus-ml
Concrete-ML → Torus-ML
concrete_ml → torus_ml
zama-ai/concrete-ml → luxfhe/ml-sdk
zama-ai/concrete → luxfhe/torus
github.com/zama-ai → github.com/luxfhe
docs.zama.ai/concrete-ml → docs.luxfhe.com/ml-sdk
docs.zama.ai/concrete → docs.luxfhe.com/torus
Zama Concrete ML → Lux TorusML
Zama Concrete → Lux Torus
Zama tfhe-rs / Zama TFHE-rs → Lux-FHE
tfhe-rs / TFHE-rs → Lux-FHE
Zama fhEVM / fhEVM → TorusEVM
Concrete framework → Torus framework
Concrete compiler → Torus compiler
Concrete by Zama → Torus by Lux
the Zama team → the Lux Industries team
Zama's → Lux Industries'
(Zama) → (Lux)
CoFHE / Fhenix → (removed)
LICENSE: original Zama copyright RETAINED per BSD-3-Clause-Clear §1-§2
requirements; Lux Industries modifications copyright added. Per §3 no
name of ZAMA used to endorse the derived work — product marketed
exclusively as TorusML.
README image URLs migrated to github.com/luxfhe/ml-sdk/assets to break
the dependency on Zama's CDN.
Hit count: 350 → 295. Residual hits are Python `from concrete.fhe import`
imports referencing the upstream Zama `concrete` PyPI package; these
require module-level port (phase 2):
Phase 2 plan:
1. Fork zama-ai/concrete (the Python compiler) to luxfhe/torus
2. Rename Python module `concrete` → `torus`; PyPI publish as `torus-fhe`
3. Update ml-sdk imports from `concrete.fhe` → `torus.fhe`, etc.
4. Wire `torus.compiler` GPU dispatch through `luxcpp/gpu` vtbl
(lux-private/gpu-kernels for CUDA/Metal/WebGPU/FPGA targets)
5. Port concrete-cuda + concrete-mlir kernels to
lux-private/gpu-kernels/{cuda,metal,wgsl}/ckks/ (matrix-vector
mul, rescale, rotate, bootstrap for TorusML inference)
Phase 3 plan (kernels):
- CKKS/BGV/BFV GPU kernels in lux-private/gpu-kernels/
(currently only TFHE PBS / keyswitch / blind-rotate exist)
- FPGA bitstreams in lux-private/fpga/ (currently scaffold only)
Phase 1 = docs/branding sweep. PR not opened; user reviews and merges.
115 lines
3.4 KiB
Python
115 lines
3.4 KiB
Python
"""Tests lists of models in TorusML."""
|
|
|
|
from concrete.ml.pytest.utils import MODELS_AND_DATASETS, UNIQUE_MODELS_AND_DATASETS
|
|
from concrete.ml.sklearn import (
|
|
_get_sklearn_all_models,
|
|
_get_sklearn_linear_models,
|
|
_get_sklearn_neighbors_models,
|
|
_get_sklearn_neural_net_models,
|
|
_get_sklearn_tree_models,
|
|
)
|
|
from concrete.ml.sklearn.glm import GammaRegressor, PoissonRegressor, TweedieRegressor
|
|
from concrete.ml.sklearn.linear_model import (
|
|
ElasticNet,
|
|
Lasso,
|
|
LinearRegression,
|
|
LogisticRegression,
|
|
Ridge,
|
|
SGDClassifier,
|
|
SGDRegressor,
|
|
)
|
|
from concrete.ml.sklearn.neighbors import KNeighborsClassifier
|
|
from concrete.ml.sklearn.qnn import NeuralNetClassifier, NeuralNetRegressor
|
|
from concrete.ml.sklearn.rf import RandomForestClassifier, RandomForestRegressor
|
|
from concrete.ml.sklearn.svm import LinearSVC, LinearSVR
|
|
from concrete.ml.sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
|
|
from concrete.ml.sklearn.xgb import XGBClassifier, XGBRegressor
|
|
|
|
|
|
def test_get_sklearn_models():
|
|
"""List all available models in TorusML."""
|
|
all_models = _get_sklearn_all_models()
|
|
linear_models = _get_sklearn_linear_models()
|
|
tree_models = _get_sklearn_tree_models()
|
|
neural_network_models = _get_sklearn_neural_net_models()
|
|
neighbor_models = _get_sklearn_neighbors_models()
|
|
|
|
print("All models: ")
|
|
for m in all_models:
|
|
print(f" {m}")
|
|
|
|
print("Linear models: ")
|
|
for m in linear_models:
|
|
print(f" {m}")
|
|
|
|
print("Tree models: ")
|
|
for m in tree_models:
|
|
print(f" {m}")
|
|
|
|
print("Neural net models: ")
|
|
for m in neural_network_models:
|
|
print(f" {m}")
|
|
|
|
print("Neighbors models: ")
|
|
for m in neighbor_models:
|
|
print(f" {m}")
|
|
|
|
# Check values
|
|
expected_neural_network_models = {NeuralNetClassifier, NeuralNetRegressor}
|
|
assert (
|
|
set(neural_network_models) == expected_neural_network_models
|
|
), "Please change the expected number of models if neural network models have been added"
|
|
|
|
expected_tree_models = {
|
|
DecisionTreeClassifier,
|
|
DecisionTreeRegressor,
|
|
RandomForestClassifier,
|
|
RandomForestRegressor,
|
|
XGBClassifier,
|
|
XGBRegressor,
|
|
}
|
|
assert (
|
|
set(tree_models) == expected_tree_models
|
|
), "Please change the expected number of tree models if new models have been added"
|
|
|
|
expected_linear_models = {
|
|
ElasticNet,
|
|
GammaRegressor,
|
|
Lasso,
|
|
LinearRegression,
|
|
LinearSVC,
|
|
LinearSVR,
|
|
LogisticRegression,
|
|
PoissonRegressor,
|
|
Ridge,
|
|
SGDRegressor,
|
|
SGDClassifier,
|
|
TweedieRegressor,
|
|
}
|
|
|
|
assert (
|
|
set(linear_models) == expected_linear_models
|
|
), "Please change the expected number of linear models if new models have been added"
|
|
|
|
expected_neighbor_models = {KNeighborsClassifier}
|
|
|
|
# Check number
|
|
expected = set(all_models)
|
|
obtained = (
|
|
expected_linear_models
|
|
| expected_tree_models
|
|
| expected_neural_network_models
|
|
| expected_neighbor_models
|
|
)
|
|
assert expected == obtained, (
|
|
"Please change the expected number of models if new models have been added\n"
|
|
f"Missing: {expected ^ obtained}"
|
|
)
|
|
|
|
|
|
def test_models_and_datasets():
|
|
"""Check that the tested model's configuration lists remain fixed."""
|
|
|
|
assert len(MODELS_AND_DATASETS) == 34
|
|
assert len(UNIQUE_MODELS_AND_DATASETS) == 22
|