Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add step to Cythonize parts of Distributed #33

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

jakirkham
Copy link
Collaborator

@jakirkham jakirkham commented Nov 30, 2020

Adds a step to the nightly benchmarks to Cythonize some modules in Distributed in-place. We go ahead and do this in the environment's site-packages as this environment exists for this benchmark work. So altering it this way shouldn't present an issue.

echo "Cythonize Distributed"
pushd "${CONDA_PREFIX}/lib/python3.8/site-packages/"
cythonize -i \
"distributed/protocol/serialize.py"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already has some bits for Cython (though not everywhere). So went ahead and Cythonized it. Though if it causes issues for some reason, we can skip this as it is less critical atm.

pushd "${CONDA_PREFIX}/lib/python3.8/site-packages/"
cythonize -i \
"distributed/protocol/serialize.py"
"distributed/scheduler.py"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't made any changes here yet, but it seems like a good idea to queue this up so we are ready once we do.

@jakirkham
Copy link
Collaborator Author

Also please let me know if we want a cleanup step at the end. That should be easy to add.

@quasiben
Copy link
Owner

Seems to be working:

Cythonize Distributed
+ pushd /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/
/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages ~/GitRepos/dask-scheduler-performance/nightly-benchmark
+ cythonize -i distributed/protocol/serialize.py
Compiling /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.py because it changed.
[1/1] Cythonizing /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.py
running build_ext
building 'distributed.protocol.serialize' extension
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed
creating /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol
gcc -pthread -B /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/include/python3.8 -c /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.c -o /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.o
/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.c: In function ‘__pyx_pw_11distributed_8protocol_9serialize_25serialize’:
/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.c:6544:6: warning: ‘__pyx_v_dict_safe’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (__pyx_t_1) {
      ^
/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.c:5930:7: note: ‘__pyx_v_dict_safe’ was declared here
   int __pyx_v_dict_safe;
       ^~~~~~~~~~~~~~~~~
gcc -pthread -shared -B /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/compiler_compat -L/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib -Wl,-rpath=/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib -Wl,--no-as-needed -Wl,--sysroot=/ /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/tmp66f3_u_z/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.o -o /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.cpython-38-x86_64-linux-gnu.so
/gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /gpfs/fs1/bzaitlen/miniconda3/envs/20201130-nightly-0.17/lib/python3.8/site-packages/distributed/protocol/serialize.py
  tree = Parsing.p_module(s, pxd, full_module_name)
+ distributed/scheduler.py
/var/spool/slurm/d/job118884/slurm_script: line 26: distributed/scheduler.py: Permission denied
+ popd

@quasiben
Copy link
Owner

Thanks @jakirkham ! Merging in

@quasiben quasiben merged commit 7dc34c9 into quasiben:main Nov 30, 2020
@jakirkham jakirkham deleted the cythonize branch November 30, 2020 23:02
@jakirkham
Copy link
Collaborator Author

jakirkham commented Nov 30, 2020

Thanks Ben! 😄

This part seems interesting. What are the permissions on that file?

/var/spool/slurm/d/job118884/slurm_script: line 26: distributed/scheduler.py: Permission denied

Edit: NVM see the issue. Explained below ( #33 (review) ) with a fix in PR ( #34 ).

Comment on lines +24 to +26
cythonize -i \
"distributed/protocol/serialize.py"
"distributed/scheduler.py"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops forgot a \. Fixing with PR ( #34 ).

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.

2 participants