Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will make importing RMM faster if you don't want the hooks for cupy, numba, or pytorch. Before, a sampling trace of `import rmm` with pyinstrument shows: $ pyinstrument -i 0.01 importrmm.py _ ._ __/__ _ _ _ _ _/_ Recorded: 10:19:56 Samples: 67 /_//_/// /_\ / //_// / //_'/ // Duration: 0.839 CPU time: 0.837 / _/ v4.4.0 Program: importrmm.py 0.839 <module> importrmm.py:1 └─ 0.839 <module> rmm/__init__.py:1 ├─ 0.315 <module> rmm/allocators/torch.py:1 │ └─ 0.315 <module> torch/__init__.py:1 │ [96 frames hidden] torch, <built-in>, enum, inspect, tok... ├─ 0.297 <module> rmm/mr.py:1 │ └─ 0.297 <module> rmm/_lib/__init__.py:1 │ ├─ 0.216 <module> numba/__init__.py:1 │ │ [140 frames hidden] numba, abc, <built-in>, importlib, em... │ ├─ 0.040 <module> numba/cuda/__init__.py:1 │ │ [34 frames hidden] numba, asyncio, ssl, <built-in>, re, ... │ ├─ 0.030 __new__ enum.py:180 │ │ [5 frames hidden] enum, <built-in> │ └─ 0.011 [self] None └─ 0.227 <module> rmm/allocators/cupy.py:1 └─ 0.227 <module> cupy/__init__.py:1 [123 frames hidden] cupy, pytest, _pytest, attr, <built-i... After: $ pyinstrument -i 0.01 importrmm.py _ ._ __/__ _ _ _ _ _/_ Recorded: 10:20:10 Samples: 28 /_//_/// /_\ / //_// / //_'/ // Duration: 0.297 CPU time: 0.297 / _/ v4.4.0 Program: importrmm.py 0.296 <module> importrmm.py:1 └─ 0.296 <module> rmm/__init__.py:1 └─ 0.296 <module> rmm/mr.py:1 └─ 0.296 <module> rmm/_lib/__init__.py:1 ├─ 0.216 <module> numba/__init__.py:1 │ [141 frames hidden] numba, <built-in>, importlib, email, ... ├─ 0.040 <module> numba/cuda/__init__.py:1 │ [19 frames hidden] numba, asyncio, ssl, <built-in>, unit... ├─ 0.031 [self] None └─ 0.010 __new__ enum.py:180 [4 frames hidden] enum, <built-in>
- Loading branch information