Re:Intel Extension for Scikit-Learn
by evanb on Monday November 01, 2021 @11:43AM
(#29068246)
The syntax and usability of
seems quite clunky. I'd have preferred a syntax like
Then, maintenance would be substantially easier. If sklearnex had import-level compatibility with sklearn it'd be as simple as some simple replacements,
which seems much easier / clearer.
[ Parent
| on HN ]
Re:Intel Extension for Scikit-Learn
by sillysaurusx on Monday November 01, 2021 @12:13PM
(#29068764)
Import magic ends up causing all kinds of problems. There's no way to tell it "I just want to import your classes; I don't want you to patch!" without literally patching the library.
In general, I'm a fan of "let me call the initializer myself, at program startup." It's especially important when you want reversibility, i.e. teardown in addition to initialization, which pops up all the time for unit tests.
Re:Intel Extension for Scikit-Learn
by dangerbird2 on Monday November 01, 2021 @01:27PM
(#29069906)
Also networking/web apps with lifecycle hooks, where careless import-time logic can break the setup procedures. To quote zen of python, "explicit is better than implicit"
I really really loathe import magics. You end up with situations where dependencies change global behavior without a way to track down where the change is actually coming from.
patching is just one of options to enable optimizations -
You also can do already
sklearnex import SVC
There are other ways how you can enable this https://intel.github.io/scikit-learn-intelex/what-is-patchin...