Search found 84 matches

by v923z
Sat Oct 05, 2019 12:59 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

I was wondering if this could be done by ulab. I wonder how numpy does it? The problem is that the binary operators are evaluated in runtime.c, which calls the relevant implementations for the list, tuple, etc. instances. The example that I showed, [0]*5 works, because the runtime.c function proper...
by v923z
Sat Oct 05, 2019 12:05 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

pythoncoder wrote:
Sat Oct 05, 2019 11:11 am
Would it be possible to trap the exception; if it occurs use the integer to instantiate an object for which you define __mul__ etc?
But I am afraid, all this must happen at the micropython level, and not in ulab. Or have I misunderstood you?
by v923z
Fri Oct 04, 2019 10:26 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

commutative operations

Hi all, I have tried to clean up the code for binary operations, and run into a fundamental problem with commutative operators. Namely, this can be handled import ulab a = ulab.ndarray([1, 2, 3]) a*5 because the evaluation of the product operator begins with a , which is an ndarray , therefore, I ha...
by v923z
Fri Oct 04, 2019 10:05 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

chuckbook wrote:
Fri Oct 04, 2019 9:18 am
Don't get confused about the absolute size of the code. There are a lot of additional features included. I just wanted to demonstrate code size increase for -Os and -O2.
Thanks!
by v923z
Thu Oct 03, 2019 5:12 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

Chuck, Here are the code sizes of -O2 and -Os build options. text data bss dec hex filename 463704 40 28052 491796 78114 build-PYBV11_O2/firmware.elf 424484 40 28052 452576 6e7e0 build-PYBV11/firmware.elf You are probably compiling other modules into the firmware, because my size with the -O2 switch...
by v923z
Thu Oct 03, 2019 3:34 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

@v923z : Thanks for the info. BTW, using our build settings (gcc version 8.2.0, -O2) the test gave 1.8ms on PYBV11. O2 results in bigger code size but it makes sense to use it if there is some spare flash available. Good to know. I have used the standard settings, beyond passing the USER_C_MODULES ...
by v923z
Thu Oct 03, 2019 2:00 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

v923z wrote : I think there is a misunderstanding stemming from this post: chuckbook wrote : ↑ Fri Sep 27, 2019 1:13 pm Very impressive! Thanks for sharing this. 1k FFT (SP) in ~0.8ms on PYBD, not bad. In the original post, I quoted a measurement of 1.948 ms, and claimed that the FFT could be gotte...
by v923z
Thu Oct 03, 2019 10:11 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: FFT speed

Peter, On the other hand, the assembly code worked with 16-bit integers, didn't it? Which in itself is not necessarily a drawback, given that the results of the ADC are also integers. That was a very old version. It used 32 bit integers, and dated to a time when the inline assembler didn't support f...
by v923z
Wed Oct 02, 2019 1:35 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: FFT speed

I'm astounded by these figures. I've just run my assembler solution on Pyboard D at 214MHz. A 1K DFT takes 3.5ms (on SF2W or SF6W). I never pretended my code was optimised, but the fact that a modern compiler running the same algorithm beats it by a factor of four is a revelation. Peter, @chuckbook...
by v923z
Thu Sep 26, 2019 5:39 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 33
Views: 748

Re: ulab, or what you will - numpy on bare metal

I think stijn's suggestion with the macros is going to be OK. Especially useful was the observation that the for loop should be the innermost statement. I believe, with that one can save a lot of time. Moreover, with the macro, one can get rid of the ndarray_get_float_value() function call, which sh...