-
Notifications
You must be signed in to change notification settings - Fork 639
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
Don't require scipy for regular use #948
Don't require scipy for regular use #948
Conversation
Thanks for raising this, makes sense! I need to discuss this with the other maintainers first. I put it on my list. Will get back to you. |
56e47d7
to
edc83e2
Compare
edc83e2
to
996f23f
Compare
Rebased post #488. |
install_requires=['torch', 'numpy'], | ||
extras_require={ | ||
'benchmark': ['pandas', 'matplotlib'], | ||
'test': ['scipy'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is create_normal_map
only used for testing? Otherwise the name might be confusing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only call to the function is in a test (and it's mentioned in a couple copy-pasted comments too):
(bitsandbytes) ~/b/bitsandbytes (main) $ ag create_normal_map
tests/test_functional.py
2356: code = F.create_normal_map()
bitsandbytes/nn/modules.py
306: Implementation of the NF4 data type in bitsandbytes can be found in the `create_normal_map` function in
bitsandbytes/functional.py
236:def create_normal_map(offset=0.9677083, use_extra_value=True):
847: Implementation of the NF4 data type in bitsandbytes can be found in the `create_normal_map` function
I can't find other relevant references to it across all of GitHub either – and anyway, the function is still there for downstream users who might need it, they'll just need scipy
installed.
extras_require={'benchmark': ['pandas', 'matplotlib']}, | ||
install_requires=['torch', 'numpy'], | ||
extras_require={ | ||
'benchmark': ['pandas', 'matplotlib'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these runtime dependencies at all? The seem to be used only in scripts and are not part of the wheel? Maybe the benchmark
extra is not needed at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that when desiring to run the benchmark scripts, you'd do
pip install -e .[benchmark]
to get the regular requirements plus the things required for benchmarking, or if you want that and the test deps,
pip install -e .[benchmark,test]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn’t this also make it part of the public metadata, e.g “pip install bitsandbytes[benchmark]” ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does.
Checked with Tim. He agrees that this makes sense and sees no issue with it. Thanks for raising this and taking the initiative to provide a fix! |
32be289
into
bitsandbytes-foundation:main
Refs #488.
The only use for
scipy.stats.norm
iscreate_normal_map
, so it probably does not need to be a hard requirement for any and all users of the library.Many users will of course have it installed anyway.