From 6101c27b5f3d9d5bdc73c29169094cec249fa2c9 Mon Sep 17 00:00:00 2001 From: Franck Charras <29153872+fcharras@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:00:01 +0200 Subject: [PATCH] Do not confusely display 'numpy' as a compute runtime (#17) --- benchmarks/kmeans/results.csv | 12 ++++++------ benchmarks/kmeans/solvers/scikit_learn_intelex.py | 8 ++++---- benchmarks/pca/solvers/scikit_learn_intelex.py | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/benchmarks/kmeans/results.csv b/benchmarks/kmeans/results.csv index 090d71d..62d769c 100644 --- a/benchmarks/kmeans/results.csv +++ b/benchmarks/kmeans/results.csv @@ -1,6 +1,6 @@ Benchmark id,Dtype,Nb data samples,Nb data features,Nb clusters,Init type,Data sample weights,Walltime,Backend provider,Compute device,Compute runtime,Nb cpus,Cpu name,Gpu name,RAM (GB),Platform,Platform architecture,Platform release,Run date,Version info,Comment,Result nb iterations,Result inertia,Data random state,Solver random state d100dd1c,float32,50000000,14,127,random,None,5.36,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,267392288.0,123,123 -d100dd1c,float32,50000000,14,127,random,None,8.32,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,267392260.0,123,123 +d100dd1c,float32,50000000,14,127,random,None,8.32,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,267392260.0,123,123 d100dd1c,float32,50000000,14,127,random,None,9.05,cuml,gpu,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,cuml 23.8.0,TODO: check it runs Lloyd ?,101,267388064.0,123,123 d100dd1c,float32,50000000,14,127,random,None,12.4,kmeans-dpcpp,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-09,dev,,100,267392256.0,123,123 d100dd1c,float32,50000000,14,127,random,None,28.2,sklearn-pytorch-engine,cuda,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,267392288.0,123,123 @@ -19,7 +19,7 @@ d100dd1c,float32,50000000,14,127,random,None,966,sklearn-pytorch-engine,cpu,,64, 8a3b498a,float32,50000000,14,127,random,random,186,kmeans-dpcpp,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-09,dev,,100,133726376.0,123,123 8a3b498a,float32,50000000,14,127,random,random,542,sklearn-numba-dpex,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,Not optimized for CPU.,100,429838976.0,123,123 8a3b498a,float32,50000000,14,127,random,random,977,sklearn-pytorch-engine,cpu,,64,AMD EPYC 7742 64-Core Processor,,1007,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-14,sklearn-pytorch-engine dev; torch 2.1.0,,100,133726048.0,123,123 -e8a8e807,float32,50000000,14,127,k-means++,None,13,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,267389460.0,123,123 +e8a8e807,float32,50000000,14,127,k-means++,None,13,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,267389460.0,123,123 e8a8e807,float32,50000000,14,127,k-means++,None,37.8,sklearn-pytorch-engine,cuda,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,267390224.0,123,123 e8a8e807,float32,50000000,14,127,k-means++,None,177,sklearn-pytorch-engine,xpu,,224,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-13,sklearn-pytorch-engine dev; torch 1.13.0a0+git6c9b55e; ipex 1.13.120+xpu,,100,267388976.0,123,123 e8a8e807,float32,50000000,14,127,k-means++,None,214,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,267531648.0,123,123 @@ -32,7 +32,7 @@ e8a8e807,float32,50000000,14,127,k-means++,None,1220,sklearn-pytorch-engine,cpu, 9920bee3,float32,50000000,14,127,k-means++,random,771,scikit-learn,,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn 1.3.0,,100,133709264.0,123,123 9920bee3,float32,50000000,14,127,k-means++,random,799,sklearn-numba-dpex,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,Not optimized for CPU.,100,519604800.0,123,123 9920bee3,float32,50000000,14,127,k-means++,random,1210,sklearn-pytorch-engine,cpu,,64,AMD EPYC 7742 64-Core Processor,,1007,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-14,sklearn-pytorch-engine dev; torch 2.1.0,,100,133700056.0,123,123 -d3535c07,float32,10000000,14,127,random,None,1.66,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,53474024.0,123,123 +d3535c07,float32,10000000,14,127,random,None,1.66,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,53474024.0,123,123 d3535c07,float32,10000000,14,127,random,None,1.98,cuml,gpu,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,cuml 23.8.0,TODO: check it runs Lloyd ?,101,53473156.0,123,123 d3535c07,float32,10000000,14,127,random,None,3.59,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,53474008.0,123,123 d3535c07,float32,10000000,14,127,random,None,4.64,kmeans-dpcpp,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-09,dev,,100,53474032.0,123,123 @@ -52,7 +52,7 @@ e9fb2542,float32,10000000,14,127,random,random,22.4,sklearn-pytorch-engine,xpu,, e9fb2542,float32,10000000,14,127,random,random,43.4,kmeans-dpcpp,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-09,dev,,100,26728440.0,123,123 e9fb2542,float32,10000000,14,127,random,random,121,sklearn-numba-dpex,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,Not optimized for CPU.,100,104161736.0,123,123 e9fb2542,float32,10000000,14,127,random,random,196,sklearn-pytorch-engine,cpu,,64,AMD EPYC 7742 64-Core Processor,,1007,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-14,sklearn-pytorch-engine dev; torch 2.1.0,,100,26728460.0,123,123 -5b29b557,float32,10000000,14,127,k-means++,None,2.63,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,53468250.0,123,123 +5b29b557,float32,10000000,14,127,k-means++,None,2.63,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,53468250.0,123,123 5b29b557,float32,10000000,14,127,k-means++,None,7.32,sklearn-pytorch-engine,cuda,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,53476752.0,123,123 5b29b557,float32,10000000,14,127,k-means++,None,34,sklearn-pytorch-engine,xpu,,224,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-13,sklearn-pytorch-engine dev; torch 1.13.0a0+git6c9b55e; ipex 1.13.120+xpu,,100,53466160.0,123,123 5b29b557,float32,10000000,14,127,k-means++,None,49.1,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,53482060.0,123,123 @@ -66,7 +66,7 @@ e9fb2542,float32,10000000,14,127,random,random,196,sklearn-pytorch-engine,cpu,,6 00047a47,float32,10000000,14,127,k-means++,random,153,sklearn-numba-dpex,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,Not optimized for CPU.,100,169065104.0,123,123 00047a47,float32,10000000,14,127,k-means++,random,241,sklearn-pytorch-engine,cpu,,64,AMD EPYC 7742 64-Core Processor,,1007,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-14,sklearn-pytorch-engine dev; torch 2.1.0,,100,26729392.0,123,123 9a20a3a6,float32,1000000,14,127,random,None,0.189,cuml,gpu,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,cuml 23.8.0,TODO: check it runs Lloyd ?,101,5345060.0,123,123 -9a20a3a6,float32,1000000,14,127,random,None,0.198,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,5345163.5,123,123 +9a20a3a6,float32,1000000,14,127,random,None,0.198,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,5345163.5,123,123 9a20a3a6,float32,1000000,14,127,random,None,0.594,sklearn-pytorch-engine,cuda,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,5345148.0,123,123 9a20a3a6,float32,1000000,14,127,random,None,0.856,scikit-learn,,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn 1.3.0,,100,5345157.0,123,123 9a20a3a6,float32,1000000,14,127,random,None,1.69,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,5345147.5,123,123 @@ -91,7 +91,7 @@ e9fb2542,float32,10000000,14,127,random,random,196,sklearn-pytorch-engine,cpu,,6 7c25e932,float32,1000000,14,127,random,random,19.8,sklearn-numba-dpex,cpu,opencl,64,Intel(R) Xeon(R) Platinum 8480L,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,Not optimized for CPU.,100,9888284.0,123,123 7c25e932,float32,1000000,14,127,random,random,23.2,sklearn-pytorch-engine,cpu,,64,AMD EPYC 7742 64-Core Processor,,1007,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-14,sklearn-pytorch-engine dev; torch 2.1.0,,100,2671355.25,123,123 7c25e932,float32,1000000,14,127,random,random,151,sklearn-pytorch-engine,mps,,8,Apple M1,Apple M1,16,Darwin,arm64,23.0.0,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,2671363.5,123,123 -d93db8bf,float32,1000000,14,127,k-means++,None,0.275,scikit-learn-intelex,cpu,numpy,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,5345824.0,123,123 +d93db8bf,float32,1000000,14,127,k-means++,None,0.275,scikit-learn-intelex,cpu,,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-12,scikit-learn-intelex 2023.2.1,,100,5345824.0,123,123 d93db8bf,float32,1000000,14,127,k-means++,None,0.774,sklearn-pytorch-engine,cuda,,2,Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz,NVIDIA A100-PCIE-40GB,377,Linux,x86_64,4.18.0-394.el8.x86_64,2023-10-11,sklearn-pytorch-engine dev; torch 2.1.0,,100,5345201.5,123,123 d93db8bf,float32,1000000,14,127,k-means++,None,3.08,sklearn-pytorch-engine,xpu,,224,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-88-generic,2023-10-13,sklearn-pytorch-engine dev; torch 1.13.0a0+git6c9b55e; ipex 1.13.120+xpu,,100,5344330.0,123,123 d93db8bf,float32,1000000,14,127,k-means++,None,6.2,sklearn-numba-dpex,gpu,level_zero,64,Intel(R) Xeon(R) Platinum 8480+,Intel(R) Data Center GPU Max 1100 (x4),504,Linux,x86_64,5.15.0-83-generic,2023-10-08,sklearn-numba-dpex dev; numba-dpex 0.22.0.dev0+2.g511241f1,,100,5344455.0,123,123 diff --git a/benchmarks/kmeans/solvers/scikit_learn_intelex.py b/benchmarks/kmeans/solvers/scikit_learn_intelex.py index b195d49..0d466b0 100644 --- a/benchmarks/kmeans/solvers/scikit_learn_intelex.py +++ b/benchmarks/kmeans/solvers/scikit_learn_intelex.py @@ -24,7 +24,7 @@ class Solver(BaseSolver): parameters = { "device, runtime": [ - ("cpu", "numpy"), + ("cpu", None), # TODO: replace "None" with "opencl" if relevant ("gpu", "level_zero"), ] } @@ -32,7 +32,7 @@ class Solver(BaseSolver): stopping_criterion = SingleRunCriterion(1) def skip(self, **objective_dict): - if self.runtime != "numpy": + if self.runtime is not None: try: device = dpctl.SyclDevice(f"{self.runtime}:{self.device}") except Exception: @@ -90,7 +90,7 @@ def set_objective( # issue at # https://github.com/intel/scikit-learn-intelex/issues/1534#issuecomment-1766266299 # noqa - # if self.runtime != "numpy": + # if self.runtime is not None: # device = device = dpctl.SyclDevice(f"{self.runtime}:{self.device}") # self.X = dpt.asarray(X, copy=True, device=device) @@ -138,7 +138,7 @@ def warm_up(self): ).fit(self.X, y=None, sample_weight=self.sample_weight) def run(self, _): - with nullcontext() if (self.runtime == "numpy") else config_context( + with nullcontext() if (self.runtime is None) else config_context( target_offload=f"{self.runtime}:{self.device}" ): estimator = KMeans( diff --git a/benchmarks/pca/solvers/scikit_learn_intelex.py b/benchmarks/pca/solvers/scikit_learn_intelex.py index 7b71658..dda37a8 100644 --- a/benchmarks/pca/solvers/scikit_learn_intelex.py +++ b/benchmarks/pca/solvers/scikit_learn_intelex.py @@ -24,7 +24,7 @@ class Solver(BaseSolver): parameters = { "device, runtime": [ - ("cpu", "numpy"), + ("cpu", None), # TODO: replace "None" with "opencl" if relevant ("gpu", "level_zero"), ], "svd_solver, power_iteration_normalizer": [ @@ -38,7 +38,7 @@ class Solver(BaseSolver): stopping_criterion = SingleRunCriterion(1) def skip(self, **objective_dict): - if self.runtime != "numpy": + if self.runtime is not None: try: device = dpctl.SyclDevice(f"{self.runtime}:{self.device}") except Exception: @@ -106,7 +106,7 @@ def run(self, _): if power_iteration_normalizer is None: power_iteration_normalizer = "auto" - with nullcontext() if (self.runtime == "numpy") else config_context( + with nullcontext() if (self.runtime is None) else config_context( target_offload=f"{self.runtime}:{self.device}" ): estimator = PCA(