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

pack_int32_to_int4 #29

Open
YangNuoCheng opened this issue Jan 16, 2022 · 2 comments
Open

pack_int32_to_int4 #29

YangNuoCheng opened this issue Jan 16, 2022 · 2 comments

Comments

@YangNuoCheng
Copy link

In 'HAWQ-main/tvm_benchmark/hawq_utils_resnet50.py' ,we pack 8 'int4' number to 1 'int32' number, so we got int4 speedup.
Can we pack 16 'int2' to 1 'int32', to got int2 speedup?

@zachzzc
Copy link
Collaborator

zachzzc commented Jan 18, 2022

Yes. The purpose of the packing is to handle with memory movement with a datatype that is supported in the target hardware (int8, int32 in cpu/gpu). If you want to further reduce the precision to int2, in cpu/gpu you also need to pack them into a byte-addressable data type (int8, int32) before the memory movement

@YangNuoCheng
Copy link
Author

YangNuoCheng commented Jan 19, 2022

Yes. The purpose of the packing is to handle with memory movement with a datatype that is supported in the target hardware (int8, int32 in cpu/gpu). If you want to further reduce the precision to int2, in cpu/gpu you also need to pack them into a byte-addressable data type (int8, int32) before the memory movement

Thank you for your reply!
Actually I am reproducing your great project, and I Try to reply it in my research.
Thanks a lot!

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

No branches or pull requests

2 participants