Re: Question: Can LowLevelCallable functions be beneficial to scipy.optimize performance?

Andrew Nelson <[email protected]> Mon, 19 Feb 2024 12:32:59 +1100
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CAAbtOZdwMbqdipir2D4CndozfiArf2pg5-F_Oiase9RnKF7Siw@mail.gmail.com>
--===============5418871395304015100==
Content-Type: multipart/alternative; boundary="00000000000098fde90611b2130d"

--00000000000098fde90611b2130d
Content-Type: text/plain; charset="UTF-8"

On Mon, 19 Feb 2024 at 07:15, <[email protected]> wrote:

> I also have found tremendous benefits from LowLevelCallable in my
> applications. Here is a small benchmark I gathered :
> https://gabrielfougeron.github.io/choreo-docs/_build/auto_examples/benchmarks/ODE_ivp_LowLevel_bench.html#sphx-glr-build-auto-examples-benchmarks-ode-ivp-lowlevel-bench-py
>

Hi Gabriel,
your reply is interesting. Personally I find it hard to follow the scipy
repo example for using a LowlevelCallable from cython/c. The examples you
present at
https://github.com/gabrielfougeron/choreo/tree/main/choreo/scipy_plus/cython
are slightly easier to follow, but could be made clearer still - it's taken
me a while of glazing at the screen to start to follow things there.

I also didn't see an example (either yours or in scipy repo) for where the
LowlevelCallable could return an array/memoryview. This is often what one
would do from a cpdef'd cython function, rather than modifying an array
in-place.

Do you think it would be possible to develop your examples to the point
where it's an easier tutorial for using LowlevelCallable?

Andrew.

--00000000000098fde90611b2130d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, 19 Feb 2024 at 07:15, &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt;=
 wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"auto"><div>I also have found tremendous bene=
fits from LowLevelCallable in my applications. Here is a small benchmark I =
gathered : <a href=3D"https://gabrielfougeron.github.io/choreo-docs/_build/=
auto_examples/benchmarks/ODE_ivp_LowLevel_bench.html#sphx-glr-build-auto-ex=
amples-benchmarks-ode-ivp-lowlevel-bench-py" target=3D"_blank">https://gabr=
ielfougeron.github.io/choreo-docs/_build/auto_examples/benchmarks/ODE_ivp_L=
owLevel_bench.html#sphx-glr-build-auto-examples-benchmarks-ode-ivp-lowlevel=
-bench-py</a></div></div></blockquote><div><br></div><div>Hi Gabriel,</div>=
<div>your reply is interesting. Personally I find it hard to follow the sci=
py repo example for using a LowlevelCallable from cython/c. The examples yo=
u present at=C2=A0<a href=3D"https://github.com/gabrielfougeron/choreo/tree=
/main/choreo/scipy_plus/cython">https://github.com/gabrielfougeron/choreo/t=
ree/main/choreo/scipy_plus/cython</a> are slightly easier to follow, but co=
uld be made clearer still - it&#39;s taken me a while of glazing at the scr=
een to start to follow things there.=C2=A0</div><div><br></div><div>I also =
didn&#39;t see an example (either yours or in scipy repo) for where the Low=
levelCallable could return an array/memoryview. This is often what one woul=
d do from a cpdef&#39;d cython function, rather than modifying an array in-=
place.</div><div><br></div><div>Do you think it would be possible to develo=
p your examples to the point where it&#39;s an easier tutorial for using Lo=
wlevelCallable?</div><div><br></div><div>Andrew.</div></div></div>

--00000000000098fde90611b2130d--

--===============5418871395304015100==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]

--===============5418871395304015100==--