[Numpy-discussion] Re: next NumPy Newcomers' Hour - 12pm UTC

2023-10-31 Thread Ganesh Kathiresan
Our next Newcomers' Hour will be held this Thursday, Nov 2nd, at 12pm UTC.
Stop by to ask questions or just to say hi.
To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both
Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09

Thanks,
Ganesh

On Sun, Jun 11, 2023 at 8:43 PM Inessa Pawson  wrote:

> Our next Newcomers' Hour will be held this Thursday, June 15th, at 12pm
> UTC. Stop by to ask questions, share your progress, or just to say hi.
> To add to the meeting agenda the topics you’d like to discuss, follow the
> link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both
> Join the meeting via Zoom:
> https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09
>
> --
> Cheers,
> Inessa
>
> Inessa Pawson
> Contributor Experience Lead | NumPy
> https://numpy.org/
> GitHub: inessapawson
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ganesh3...@gmail.com
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] next NumPy Newcomers' Hour - December 28th, 2023 at 12 PM UTC

2023-12-28 Thread Ganesh Kathiresan
Apologies for the late notice!

Our next Newcomers' Hour will be held this Thursday, 28th, 2023 at 12 PM
UTC,  Stop by to ask questions, share your progress, celebrate success, or
just to say hi.

To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both.

Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09.

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Making show_runtime and show_config enable file output

2024-04-10 Thread Ganesh Kathiresan
Thanks for the input, I have raised a PR: 
https://github.com/numpy/numpy/pull/26255. I'll address the UT issues soon. Let 
me know if this is what was required.

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Next NumPy Newcomers' Hour - April 18th, 2024 at 12pm UTC

2024-04-16 Thread Ganesh Kathiresan
Our next Newcomers' Hour will be held on Thursday, April 18th at 12pm UTC. Stop
by to ask questions, share your progress, celebrate success, or just to say
hi.

To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both.

Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09.

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Next NumPy Newcomers' Hour - June 13th, 2023 at 12 PM UTC

2024-06-10 Thread Ganesh Kathiresan
Our next Newcomers' Hour will be held this Thursday, 13th, 2023 at 12 PM
UTC,  Stop by to ask questions, share your progress, celebrate success, or
just to say hi.

To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both.

Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09.

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Next NumPy Newcomers' Hour - July 11th, 2024 at 12 PM UTC

2024-07-10 Thread Ganesh Kathiresan
Our next Newcomers' Hour will be held this Thursday, 11th, 2024 at 12 PM
UTC,  Stop by to ask questions, share your progress, celebrate success, or
just to say hi.

To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both.

Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09.

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Next NumPy Newcomers' Hour - 12 pm UTC

2024-08-07 Thread Ganesh Kathiresan
Our next Newcomers' Hour will be held this Thursday, August 8th at 12 PM
UTC. Stop by to ask questions or just to say hi.

To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/3f3otyyuTte3FU9y3QzsLg?both

Join the meeting via Zoom:
https://us06web.zoom.us/j/82563808729?pwd=ZFU3Z2dMcXBGb05YemRsaGE1OW5nQT09

Thanks,
Ganesh
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] ENH: Changed repr of np.bool_ #17592 (requesting confirmation)

2020-10-23 Thread Ganesh Kathiresan
Hi All,

I have raised a PR to change the
np.bool_ string representation to avoid confusion with python's True and
False as mentioned in this issue
.

This change makes string representation of np.bool_ into numpy.True_ and
numpy.False_

As Eric mentioned, I wanted your feedback on the change and if we can go
ahead with this idea.

Regards,
Ganesh
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Proposal for adding bit_count

2021-07-29 Thread Ganesh Kathiresan
Hi All,



I am working  on a new UFunc, `
bit_count ` (popcount in
other languages) that aims to count the number of 1-bits in
the absolute value of an Integer.


Implementation
--

The primary reference for the implementation is CountBitsSetParallel
.
Here we take 12 operations to achieve the result which is the same as the
lookup table method but does not suffer from memory issues or cache misses.

The implementation is aimed at unsigned integers, absolute value of signed
integers and objects that support the operation.


Usage
--

>>> np.bit_count(1023)

10

>>> a = np.array([2**i - 1 for i in range(16)])

>>> np.bit_count(a)

array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15])

>>> np.int32(1023).bit_count()

10


Notes
-

1. Python has included this method here

 (3.10+). Tracking issue 

2.  NumPy tracking issue 

3.  Interesting read
 on
how we get the magic number. Needed a bit of digging :)


Please let us know what you think about the implementation and where we can
improve in terms of performance or interface.

Regards,
Ganesh
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Proposal for adding bit_count

2021-08-04 Thread Ganesh Kathiresan
>
> Should `np.ndarray.bit_count()` exist?  I tend against this;


Thanks for the info Sebastian, I agree with this as we can stick to what
Python offers.

Should `np.bit_count` exist?  Having it on the int* types may be sufficient.


Hey Stephan, regarding this, I felt we could support it in the same lines NumPy
Mathematical Functions
, something like
GCD perhaps, where we do not have `np.ndarray.gcd` but do have an `np.gcd`

What is the max value of the count?  64?  If so it can go in a uint8.


This makes sense yeah, will make this change, thanks for the suggestion.

Also, an interesting future proposal can be to club all the bitwise
functions into a single "namespace" of sorts and have np.bits.*. This has
already been suggested in this comment
 and I
feel this would be a clean addition and we can support other useful
functions as well.

Regards,
Ganesh

On Tue, Aug 3, 2021 at 9:18 PM Sebastian Berg 
wrote:

> On Mon, 2021-08-02 at 13:10 -0700, Stefan van der Walt wrote:
> > On Mon, Aug 2, 2021, at 10:50, Sebastian Berg wrote:
> > > * Should `np.ndarray.bit_count()` exist?  I tend against this;
> > >   but we should have it on (integer) scalars to mirror the
> > >   Python `int`.
> >
> > Should `np.bit_count` exist?  Having it on the int* types may be
> > sufficient.
>
> Right, we could add it only to the integer scalars mostly for Python
> compatibility.  The PR suggests to create a ufunc to make the feature
> available to typical NumPy code (allow using it with arrays).
>
> >
> > > * The return value is currently the same type as the input.  That
> > >   means that: `np.bit_count(uint8)` returns the count as `uint8`
> > >   while `np.bit_count(int32)` returns it as `int32`, etc.
> >
> > What is the max value of the count?  64?  If so it can go in a uint8.
>
> Yes, uint8 would even work for 128 bit integers.  I was a bit unsure
> about this, since we rarely create non-default integer arrays unless
> prompted, but it is a good option as well.
>
> Cheers,
>
> Sebastian
>
>
> >
> > Stéfan
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@python.org
> > https://mail.python.org/mailman/listinfo/numpy-discussion
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Display runtime information through a new function: `show_runtime`

2022-08-06 Thread Ganesh Kathiresan
Hi Team,

We are planning on adding a new function called `np.show_runtime` to
display the runtime information of the machine in addition to
`np.show_config` which displays the build-related information.
Relevant PR: ENH: Use threadpoolctl in show_runtime (a new function) #21468


Reasons for new function:
1. Will be helpful in root-causing issuing with information from the
acceleration frameworks.
2. Build time information alone is not always helpful [1]

Sample Output of new function

>>> np.show_runtime()
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
  'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
  'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
 {'architecture': 'Zen',
  'filepath': 
'/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so',
  'internal_api': 'openblas',
  'num_threads': 12,
  'prefix': 'libopenblas',
  'threading_layer': 'pthreads',
  'user_api': 'blas',
  'version': '0.3.20'}]

Under the hood
`np.show_runtime` will use `threadpoolctl` [2] to get the runtime
information of the frameworks. In addition to this, we will also display
useful SIMD extensions that are supported.

Future Scope
1. When we move towards meson, we can leverage the additional information
and revamp `np.show_config` to utilize it.
2. If needed, we can gradually merge `show_runtime` and `show_config` to
display information in sections and various other formats.

Please do let us know if you have any suggestions on improving this
function or concerns about the information provided by the new function.

Thanks,
Ganesh

[1] show_config displays useless info when installed through conda-forge
channel  (#14492)
[2] threadpoolctl 
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Adding bit_count ufunc

2022-12-04 Thread Ganesh Kathiresan
Hi all,

Thanks for the suggestions! I have gotten the PR to a working state with UT
on top of the latest main (PR ).

So it looks to me like this new ufunc should be called `bitwise_count`
> rather than `bit_count`.


This does sound like a good idea, but would it confuse the users given the
scalar version is called `bit_count`? We could change/add an alias for
scalar bit_count to `bitwise_count` but that would be different from the
Python `bit_count
` added in
3.10. Any idea on how to proceed? I'm ok with calling it `bitwise_count` or
`bit_count`.

Thanks,
Ganesh

On Thu, Dec 1, 2022 at 3:20 AM Ralf Gommers  wrote:

>
>
> On Fri, Nov 25, 2022 at 9:55 PM Serge Guelton 
> wrote:
>
>> On Fri, Nov 25, 2022 at 08:09:02PM +0100, Sebastian Berg wrote:
>> > Thanks for bringing this up again.  The Python method exists and it
>> > seems like relatively basic functionality.
>> >
>> > Overall, I am slightly in favor of adding the ufunc.  So if nobody
>> > voices an opinion that it doesn't seem a good fit for NumPy, I would be
>> > happy to move forward with it.
>>
>
> It seems like there is enough demand, so +0.5 from me.
>
>
>> > PS: One of my main concern would be if we were to add many bitwise
>> > functions, in which case a `bitwise` namespace might be nice.  But I am
>> > not convinced that should stop us here.
>>
>> Technically speaking, bitwise_and, birwise_or, bitwise_xor and bitwise_not
>> already exist and popcount is widely spread, it already has its compiler
>> builtin
>> under the name of __builtin_popcount
>>
>
> Those four `bitwise_*` functions also came to mind for me. I'll also add
> that Python has six bit-wise operators (
> https://wiki.python.org/moin/BitwiseOperators), and because of that the
> array API standard implements `bitwise_left_shift` and
> `bitwise_right_shift` in addition to the four functions that NumPy has.
>
> So it looks to me like this new ufunc should be called `bitwise_count`
> rather than `bit_count`.
>
> Cheers,
> Ralf
>
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ganesh3...@gmail.com
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Adding bit_count ufunc

2022-12-04 Thread Ganesh Kathiresan
>
>  as long as the correspondence is mentioned in the docstring this should
> be discoverable enough


Ah ok, that's a good point. I will make the change. Thanks!

~Ganesh

On Mon, Dec 5, 2022 at 3:21 AM Ralf Gommers  wrote:

>
>
> On Sun, Dec 4, 2022 at 6:30 PM Ganesh Kathiresan 
> wrote:
>
>> Hi all,
>>
>> Thanks for the suggestions! I have gotten the PR to a working state with
>> UT on top of the latest main (PR
>> <https://github.com/numpy/numpy/pull/21429>).
>>
>> So it looks to me like this new ufunc should be called `bitwise_count`
>>> rather than `bit_count`.
>>
>>
>> This does sound like a good idea, but would it confuse the users given
>> the scalar version is called `bit_count`? We could change/add an alias for
>> scalar bit_count to `bitwise_count` but that would be different from the
>> Python `bit_count
>> <https://docs.python.org/3/library/stdtypes.html#int.bit_count>` added
>> in 3.10. Any idea on how to proceed? I'm ok with calling it `bitwise_count`
>> or `bit_count`.
>>
>
> I don't think it would confuse users. This is not a feature for the
> beginner/average user, it will have few users right now, and as long as the
> correspondence is mentioned in the docstring this should be discoverable
> enough. I'd much prefer no alias, we already have way too many of those and
> most of them are only noise at this point.
>
> Cheers,
> Ralf
>
>
>> Thanks,
>> Ganesh
>>
>> On Thu, Dec 1, 2022 at 3:20 AM Ralf Gommers 
>> wrote:
>>
>>>
>>>
>>> On Fri, Nov 25, 2022 at 9:55 PM Serge Guelton 
>>> wrote:
>>>
>>>> On Fri, Nov 25, 2022 at 08:09:02PM +0100, Sebastian Berg wrote:
>>>> > Thanks for bringing this up again.  The Python method exists and it
>>>> > seems like relatively basic functionality.
>>>> >
>>>> > Overall, I am slightly in favor of adding the ufunc.  So if nobody
>>>> > voices an opinion that it doesn't seem a good fit for NumPy, I would
>>>> be
>>>> > happy to move forward with it.
>>>>
>>>
>>> It seems like there is enough demand, so +0.5 from me.
>>>
>>>
>>>> > PS: One of my main concern would be if we were to add many bitwise
>>>> > functions, in which case a `bitwise` namespace might be nice.  But I
>>>> am
>>>> > not convinced that should stop us here.
>>>>
>>>> Technically speaking, bitwise_and, birwise_or, bitwise_xor and
>>>> bitwise_not
>>>> already exist and popcount is widely spread, it already has its
>>>> compiler builtin
>>>> under the name of __builtin_popcount
>>>>
>>>
>>> Those four `bitwise_*` functions also came to mind for me. I'll also add
>>> that Python has six bit-wise operators (
>>> https://wiki.python.org/moin/BitwiseOperators), and because of that the
>>> array API standard implements `bitwise_left_shift` and
>>> `bitwise_right_shift` in addition to the four functions that NumPy has.
>>>
>>> So it looks to me like this new ufunc should be called `bitwise_count`
>>> rather than `bit_count`.
>>>
>>> Cheers,
>>> Ralf
>>>
>>> ___
>>> NumPy-Discussion mailing list -- numpy-discussion@python.org
>>> To unsubscribe send an email to numpy-discussion-le...@python.org
>>> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
>>> Member address: ganesh3...@gmail.com
>>>
>> ___
>> NumPy-Discussion mailing list -- numpy-discussion@python.org
>> To unsubscribe send an email to numpy-discussion-le...@python.org
>> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
>> Member address: ralf.gomm...@gmail.com
>>
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ganesh3...@gmail.com
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com