explorer icon indicating copy to clipboard operation
explorer copied to clipboard

Optimize ops of PolarsBackend.Series using scalar values with broadcasting

Open nallwhy opened this issue 3 years ago • 0 comments

AS-IS

(series, scalar) or (scalar, series) -> expression

TO-BE

(series, scalar) or (scalar, series) -> broadcasting in polars

from @philss

I think that way going to be faster, but it's hard to maintain because some functions may have 3 possible branches: (series, series), (series, scalar), (scalar, series). We could use macros to make the work less painful.

example: https://github.com/nallwhy/explorer/commit/6c0147dcc3bd1f31590238b8ed58eda7ace9876b benchmarks: https://github.com/elixir-nx/explorer/pull/370#issuecomment-1274932347 discussion: https://github.com/elixir-nx/explorer/pull/370#issuecomment-1274950401

nallwhy avatar Oct 11 '22 16:10 nallwhy