[SciPy-Dev] GSoC proposal draft: Improve performance through the use of Pythran

Serge Guelton serge.guelton at telecom-bretagne.eu
Thu Apr 8 16:16:49 EDT 2021


On Thu, Apr 08, 2021 at 06:56:17PM +0200, David Menéndez Hurtado wrote:
> It is unfortunate that the example you choose turned up to be slower than pure
> Python. If you could figure out what turns out to be slowing it down, maybe
> pythran could fix it. But I realise this may take quite some time, so it may
> have to wait until the project starts.

Xingyu Liu opened an issue in the pythran tracker about that performance issue[1]
I've started investigating, and his problem exhibits an interesting situation,
where bascially whe have

```
if a < b:
  x[b:] = x[:a]
```

when doing an array copy like this, numpy semantic prevents usage of a memcpy,
because they may overlap. However in that case, the guard contains information
to allow the memcpy. This is an optimization that could be implemented at Python
level, but that would require an extension of the range analysis of pythran, as
it doesn't work on symbolic value. Probably not within the scope of a GSoc
though ;-)



[1] https://github.com/serge-sans-paille/pythran/issues/1753
> /David 
> 
> On Thu, 8 Apr 2021, 5:10 pm Xingyu Liu, <[1]xingyuliu at g.harvard.edu> wrote:
> 
> 
>     Hi everyone:
> 
>      
> 
>     I'm Xingyu Liu(@charlotte12l on GitHub), a first-year Data Science master
>     student at Harvard University, and I’m proficient in Python and C++. I’m
>     very interested in the project - Improve performance through the use of
>     Pythran. I did many investigations and tries on this project these days 
>     (many thanks to Ralf for helping me iterating this proposal!), and here is
>     my current proposal draft: [2]https://docs.google.com/document/d/
>     1nM7dYbmModiukQw-sSOVGz6t5S6HC0VVWucYadI_aMQ/edit?usp=sharing .
> 
>      
> 
>     I’d appreciate it if you guys can give me some tips on it!
> 
>      
> 
>     Thanks,
> 
>     Xingyu
> 
>      
> 
>     _______________________________________________
>     SciPy-Dev mailing list
>     [3]SciPy-Dev at python.org
>     [4]https://mail.python.org/mailman/listinfo/scipy-dev
> 
> 
> References:
> 
> [1] mailto:xingyuliu at g.harvard.edu
> [2] https://docs.google.com/document/d/1nM7dYbmModiukQw-sSOVGz6t5S6HC0VVWucYadI_aMQ/edit?usp=sharing
> [3] mailto:SciPy-Dev at python.org
> [4] https://mail.python.org/mailman/listinfo/scipy-dev

> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev



More information about the SciPy-Dev mailing list