DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

[BUG] Sample alexnet example for flops profiler does not work.

Open LM-AuroTripathy opened this issue 3 years ago • 1 comments
trafficstars

Describe the bug Sample alexnet example for profiler does not work. https://www.deepspeed.ai/tutorials/flops-profiler/

To Reproduce copy-paste the example as-is and run it

Expected behavior should produce the three results, flops, macs, params

ds_report output

--------------------------------------------------
DeepSpeed C++/CUDA extension op report
--------------------------------------------------
NOTE: Ops not installed will be just-in-time (JIT) compiled at
      runtime if needed. Op compatibility means that your system
      meet the required dependencies to JIT install the op.
--------------------------------------------------
JIT compiled ops requires ninja
ninja .................. [OKAY]
--------------------------------------------------
op name ................ installed .. compatible
--------------------------------------------------
cpu_adam ............... [NO] ....... [OKAY]
cpu_adagrad ............ [NO] ....... [OKAY]
fused_adam ............. [NO] ....... [OKAY]
fused_lamb ............. [NO] ....... [OKAY]
 [WARNING]  please install triton==1.0.0 if you want to use sparse attention
sparse_attn ............ [NO] ....... [NO]
transformer ............ [NO] ....... [OKAY]
stochastic_transformer . [NO] ....... [OKAY]
 [WARNING]  async_io requires the dev libaio .so object and headers but these were not found.
 [WARNING]  async_io: please install the libaio-dev package with apt
 [WARNING]  If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
async_io ............... [NO] ....... [NO]
utils .................. [NO] ....... [OKAY]
quantizer .............. [NO] ....... [OKAY]
transformer_inference .. [NO] ....... [OKAY]
--------------------------------------------------
DeepSpeed general environment info:
torch install path ............... ['/home/auro/anaconda3/envs/pyt-1.12/lib/python3.8/site-packages/torch']
torch version .................... 1.12.1
torch cuda version ............... 11.3
torch hip version ................ None
nvcc version ..................... 11.1
deepspeed install path ........... ['/home/auro/anaconda3/envs/pyt-1.12/lib/python3.8/site-packages/deepspeed']
deepspeed info ................... 0.7.0, unknown, unknown
deepspeed wheel compiled w. ...... torch 1.12, cuda 11.3

Screenshots

(pyt-1.12) auro@nomster:~/flops-profiler$ python alexnet_profiler.py
Traceback (most recent call last):
  File "alexnet_profiler.py", line 9, in <module>
    flops, macs, params = get_model_profile(model=model, # model
  File "/home/auro/anaconda3/envs/pyt-1.12/lib/python3.8/site-packages/deepspeed/profiling/flops_profiler/profiler.py", line 1202, in get_model_profile
    _ = model(*args, **kwargs)
TypeError: AlexNet object argument after ** must be a mapping, not NoneType

System info (please complete the following information):

(pyt-1.12) auro@nomster:~/flops-profiler$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic

Launcher context N/A

Docker context N/A

Additional context Invocation

python alexnet_profiler.py

LM-AuroTripathy avatar Aug 09 '22 19:08 LM-AuroTripathy

@LM-AuroTripathy thanks for reporting this issue. We are aware that some of the tutorials are outdated and we're working on improving that and the overall documentation accuracy of DeepSpeed. I'll take a look at this and provide a fix for you soon!

mrwyattii avatar Aug 11 '22 23:08 mrwyattii

@LM-AuroTripathy , thanks for pointing this out. This will be fixed by https://github.com/microsoft/DeepSpeed/pull/2443.

cli99 avatar Oct 25 '22 03:10 cli99