Skip to content

Conversation

@IvanGrigorik
Copy link
Collaborator

@IvanGrigorik IvanGrigorik commented Jan 3, 2026

This PR removes all views from examples #333
All views are changed into cupy / numpy arrays

@IvanGrigorik IvanGrigorik force-pushed the grigorik/views-deprecaton branch from 13e451c to ccf8174 Compare January 3, 2026 00:14
@IvanGrigorik
Copy link
Collaborator Author

Since examples does not have unit tests I will post before/after change results in the comment section.

@IvanGrigorik
Copy link
Collaborator Author

IvanGrigorik commented Jan 3, 2026

ExaMiniMD (success):

Click to expand

1st round:

0.0 67.1838476553003 40 - 0.5
Atoms: 256000 256000

#Timestep Temperature PotE ETot Time Atomsteps/s
0 1.400000 -6.332812 -4.232820 0.000000 0.000000e+00
10 1.266844 -6.133420 -4.233161 56.129694 4.560866e+04
20 0.771198 -5.389216 -4.232424 56.990919 2.972508e+06
30 0.619950 -5.162675 -4.232754 57.659687 3.827934e+06
40 0.717497 -5.309204 -4.232963 58.574726 2.797705e+06
50 0.715026 -5.305366 -4.232830 59.189684 4.162861e+06
60 0.710151 -5.298056 -4.232834 60.000688 3.156584e+06
70 0.718398 -5.310436 -4.232843 60.585862 4.374763e+06
80 0.726987 -5.323320 -4.232843 61.488696 2.835514e+06
90 0.731462 -5.330025 -4.232837 62.144838 3.901602e+06
100 0.733399 -5.332927 -4.232832 62.971694 3.096065e+06

#Procs Particles | Time T_Force T_Neigh T_Comm T_Other | Steps/s Atomsteps/s Atomsteps/(proc*s)
1 256000 | 62.971734 1.660649 0.519894 21.881143 38.908746 | 1.588014 4.065316e+05 4.065316e+05 PERFORMANCE

--- 
2nd round:

0.0 67.1838476553003 40 - 0.5
Atoms: 256000 256000

#Timestep Temperature PotE ETot Time Atomsteps/s
0 1.400000 -6.332812 -4.232820 0.000000 0.000000e+00
10 1.266844 -6.133420 -4.233161 0.617934 4.142895e+06
20 0.771198 -5.389216 -4.232424 1.491913 2.929131e+06
30 0.619950 -5.162675 -4.232754 2.140938 3.944380e+06
40 0.717497 -5.309204 -4.232963 3.112939 2.633740e+06
50 0.715026 -5.305366 -4.232830 3.780531 3.834682e+06
60 0.710151 -5.298056 -4.232834 4.690937 2.811933e+06
70 0.718398 -5.310436 -4.232843 5.320934 4.063515e+06
80 0.726987 -5.323320 -4.232843 6.201934 2.905783e+06
90 0.731462 -5.330025 -4.232837 6.822931 4.122410e+06
100 0.733399 -5.332927 -4.232832 7.615005 3.232020e+06

#Procs Particles | Time T_Force T_Neigh T_Comm T_Other | Steps/s Atomsteps/s Atomsteps/(proc*s)
1 256000 | 7.615043 1.584746 0.479881 3.577197 1.972683 | 13.131902 3.361767e+06 3.361767e+06 PERFORMANCE

---
before changes (1st round):

0.0 67.1838476553003 40 - 0.5
Atoms: 256000 256000


#Timestep Temperature PotE ETot Time Atomsteps/s
0 1.400000 -6.332812 -4.232820 0.000000 0.000000e+00

10 1.266844 -6.133420 -4.233161 57.213949 4.474434e+04
20 0.771198 -5.389216 -4.232424 58.013942 3.200023e+06
30 0.619950 -5.162675 -4.232754 58.475032 5.552097e+06
40 0.717497 -5.309204 -4.232963 59.239660 3.348028e+06
50 0.715026 -5.305366 -4.232830 59.865834 4.088318e+06
60 0.710151 -5.298056 -4.232834 60.678944 3.148404e+06
70 0.718398 -5.310436 -4.232843 61.310951 4.050594e+06
80 0.726987 -5.323320 -4.232843 62.099950 3.244616e+06
90 0.731462 -5.330025 -4.232837 62.621948 4.904230e+06
100 0.733399 -5.332927 -4.232832 63.432945 3.156605e+06

#Procs Particles | Time T_Force T_Neigh T_Comm T_Other | Steps/s Atomsteps/s Atomsteps/(proc*s)
1 256000 | 63.432985 1.608419 0.380175 21.993863 39.449908 | 1.576467 4.035755e+05 4.035755e+05 PERFORMANCE

---
before changes (2nd round):
0.0 67.1838476553003 40 - 0.5
Atoms: 256000 256000

#Timestep Temperature PotE ETot Time Atomsteps/s
0 1.400000 -6.332812 -4.232820 0.000000 0.000000e+00
10 1.266844 -6.133420 -4.233161 0.244516 1.047010e+07
20 0.771198 -5.389216 -4.232424 0.915181 3.817109e+06
30 0.619950 -5.162675 -4.232754 1.558867 3.977092e+06
40 0.717497 -5.309204 -4.232963 2.310190 3.407326e+06
50 0.715026 -5.305366 -4.232830 2.950178 4.000062e+06
60 0.710151 -5.298056 -4.232834 3.830181 2.909086e+06
70 0.718398 -5.310436 -4.232843 4.501175 3.815217e+06
80 0.726987 -5.323320 -4.232843 5.395179 2.863531e+06
90 0.731462 -5.330025 -4.232837 6.044192 3.944466e+06
100 0.733399 -5.332927 -4.232832 6.901182 2.987187e+06

#Procs Particles | Time T_Force T_Neigh T_Comm T_Other | Steps/s Atomsteps/s Atomsteps/(proc*s)
1 256000 | 6.901242 1.513515 0.402400 3.160306 1.824439 | 14.490145 3.709477e+06 3.709477e+06 PERFORMANCE

@IvanGrigorik
Copy link
Collaborator Author

IvanGrigorik commented Jan 3, 2026

BabelStream (workload and functor still fails, need to modify constructor_visitor.py, same for all workunits)

Click to expand

after change:

Function MBytes/sec Min (sec) Max Average
Copy 111956.567 0.00480 0.01647 0.01015
Mul 96988.533 0.00554 0.01820 0.01053
Add 105128.566 0.00766 0.02062 0.01312
Triad 115614.089 0.00697 0.03221 0.01281
Dot 143053.046 0.00375 0.01992 0.00963

before change:

Function MBytes/sec Min (sec) Max Average
Copy 86760.370 0.00619 0.01769 0.00971
Mul 109793.552 0.00489 0.01926 0.01037
Add 116662.035 0.00690 0.01606 0.01203
Triad 127049.367 0.00634 0.01934 0.01234
Dot 132840.301 0.00404 0.01502 0.00884

@IvanGrigorik
Copy link
Collaborator Author

IvanGrigorik commented Jan 3, 2026

LogisticRegression and NaiveBayes are deprecated:

Details

$ pip install sklearn
Collecting sklearn
  Using cached sklearn-0.0.post12.tar.gz (2.6 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
      rather than 'sklearn' for pip commands.
      
      Here is how to fix this error in the main use cases:
      - use 'pip install scikit-learn' rather than 'pip install sklearn'
      - replace 'sklearn' by 'scikit-learn' in your pip requirements files
        (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
      - if the 'sklearn' package is used by one of your dependencies,
        it would be great if you take some time to track which package uses
        'sklearn' instead of 'scikit-learn' and report it to their issue tracker
      - as a last resort, set the environment variable
        SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
      
      More information is available at
      https://github.com/scikit-learn/sklearn-pypi-package
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'sklearn' when getting requirements to build wheel

When trying to install scikit-learn there will be some problems with the code itself.

@IvanGrigorik
Copy link
Collaborator Author

IvanGrigorik commented Jan 3, 2026

Everything in examples directory changed to numpy/cupy views (changed where needed)
Need to change core files before changing workloads and functors
@gliga do we need to modify workloads-related files? We plan to deprecate them on Jan. 12

@gliga
Copy link
Contributor

gliga commented Jan 3, 2026

Everything in examples directory changed to numpy views. Need to change core files before changing workloads and functors @gliga do we need to modify workloads-related files? We plan to deprecate them on Jan. 12

Nothing is running on GPU?

We do not need to update examples that use workload style.

@IvanGrigorik
Copy link
Collaborator Author

IvanGrigorik commented Jan 3, 2026

Everything in examples directory changed to numpy views. Need to change core files before changing workloads and functors @gliga do we need to modify workloads-related files? We plan to deprecate them on Jan. 12

Nothing is running on GPU?

We do not need to update examples that use workload style.

It works good on GPU. For example,

@pk.workunit(cp_arr=pk.ViewTypeInfo(space=pk.CudaSpace, layout=pk.LayoutRight))
def addition_cp(i: int, cp_arr: pk.View2D[int]):
cp_arr[i][0] += 1 * i
cp_arr[i][1] += 2 * i

These example runs on GPU and works fine. It's just that most examples using numpy and OpenMP
Functors and workloads has different array handling, so they does not work.

@IvanGrigorik IvanGrigorik changed the title core: view deprecation examples: view deprecation Jan 3, 2026
@IvanGrigorik IvanGrigorik requested a review from gliga January 3, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants