#
✕ nick:lamlam
#asahi-dev · 2022-11-20 23:02
lamlamwas about to commit ane patch rn and github soft-banned me?? "Your account has been flagged. Because of that, your profile is hidden from the public"
#asahi-dev · 2022-11-20 03:24
lamlambut ive got the hardware queue/ push / trigger interface down
#asahi-dev · 2022-11-20 03:24
lamlamhehe
#asahi-dev · 2022-11-20 03:24
lamlamcaveats, the *entire* 0x4000 - 0x20000 range is configs so lots of work to do
#asahi-dev · 2022-11-20 03:20
lamlamill send the poc soon
#asahi-dev · 2022-11-20 03:20
lamlamtldr, does MADDs with input1 with input2, with LOTS of config options
#asahi-dev · 2022-11-20 03:19
lamlamkernel (image kernel) just being input2
#asahi-dev · 2022-11-20 03:19
lamlam"Neural processor circuit is a *configurable circuit* that performs neural network operations on the input data based at least on kernel data"
#asahi-dev · 2022-11-20 03:19
lamlamfrom apple themselves:
#asahi-dev · 2022-11-20 03:19
lamlamall it really is a multiply-add circuit, so it can be configured to do matmuls/elemwise too :)
#asahi-dev · 2022-11-20 03:18
lamlamTESTS ARE NCHW 2D CONV
#asahi-dev · 2022-11-20 03:17
lamlamhttps://bashify.io/images/P3ierm
#asahi-dev · 2022-11-20 03:17
lamlamIT WORKS
#asahi-dev · 2022-11-20 03:17
lamlamTHE ANE WORKS
#asahi-dev · 2022-11-20 03:16
lamlamAND MATMULS
#asahi-dev · 2022-11-20 03:16
lamlamWHO LIKES CONVOLUTIONS
#asahi-dev · 2022-11-20 03:16
lamlamanyways
#asahi-dev · 2022-11-20 03:16
lamlami believe i had a brainfart yesterday
#asahi-dev · 2022-11-18 09:41
lamlamjust looked at admac.py and that's what i was looking for. thank you!
#asahi-dev · 2022-11-18 09:41
lamlampovik: did not know regmaps can be accessed like ndarrays. neat.
#asahi-dev · 2022-11-18 07:51
lamlamand the numbers are confusing the hell out of me
#asahi-dev · 2022-11-18 07:50
lamlambut im trying to investigate async scheduling across the hw slots
#asahi-dev · 2022-11-18 07:50
lamlammy code is not only ugly
#asahi-dev · 2022-11-18 07:41
lamlamnot proxyclient/python exclusive, but generally speaking.
#asahi-dev · 2022-11-18 07:40
lamlami'd like to add definitions to make it more scalable and i'd like advice on how to set this up.
#asahi-dev · 2022-11-18 07:40
lamlami need the queue_id not just for address (e.g. queue_id*0x148 + offset) but values to fill inside those registers too
#asahi-dev · 2022-11-18 07:38
lamlamhence the manager would need a way to access the regmap with queue_id. each queue behaves the same afaik
#asahi-dev · 2022-11-18 07:38
lamlambut i have mapped the definitions s.t. the address & values are a function of queue_id.
#asahi-dev · 2022-11-18 07:38
lamlamthe individual queue itself is quite complex (e.g. address resolution table slots, network id mappings)
#asahi-dev · 2022-11-18 07:38
lamlamis what i'm talking about
#asahi-dev · 2022-11-18 07:38
lamlamhttps://patentimages.storage.googleapis.com/35/40/9a/7f655765edeb12/US20210271958A1.pdf
#asahi-dev · 2022-11-18 07:38
lamlamFIG 10 @ page 11 in this patent pdf
#asahi-dev · 2022-11-18 07:38
lamlamthere's a task manager handling 8 distinct hardware queues each with 0x148 width
#asahi-dev · 2022-11-18 07:37
lamlamwhat is good practice to define & manage register maps for this situation?
#asahi-dev · 2022-11-17 08:45
lamlambrb
#asahi-dev · 2022-11-17 08:45
lamlami just did a convolution on the ane
#asahi-dev · 2022-11-17 08:44
lamlamoh my god
#asahi-dev · 2022-11-04 21:12
lamlamnot sure which is the culprit but am seeing some *really* detailed isp logs by ane (log show --last 5m --debug --info)... might help
#asahi-dev · 2022-11-04 21:12
lamlam"amfi_allow_any_signature=1 enforceModelSignatureChecks=0 removeAuthCodeChecks=1 IOReportEnable=1 aneFWTrace=1 aneFWTraceBuffer=1 aneDebug=1 aneLogging=1"
#asahi-dev · 2022-11-04 21:12
lamlamalso i boot guest w/ these ane-specific args added:
#asahi-dev · 2022-11-04 21:12
lamlamwould not be surprised if it's the same team behind it. there's an entire apfs file-sharing protocol between the two. first ane wake is actually called by isp to init apfs lol.
#asahi-dev · 2022-11-04 21:12
lamlammillenialhacker: that's really nice work. thank you, it's helping me understand alot regarding the channels.
#asahi-dev · 2022-11-03 18:14
lamlami have been consistently hitting the magic number since, but currently i'm relying on ~400 unknown numbers to fill the dpe regs (dynamic power estimation, the last reg actually). i can account for other parts though.
#asahi-dev · 2022-11-03 18:14
lamlami'll clean this up & document it, hopefully it can make it to the asahi repos.
#asahi-dev · 2022-11-03 18:14
lamlamturns out all i needed were some sneaky tunables.
#asahi-dev · 2022-11-03 18:14
lamlammagic number means the fw successfully allocated ipc channels: 1st reg (7) is the # of chans, and 2nd (f340) is the size, 4th is heap size etc. now i can make it work for me :P
#asahi-dev · 2022-11-03 18:14
lamlamisp uses a similar protocol (https://github.com/patjak/facetimehd/blob/master/fthd_isp.c); the two are very similar in design actually.
#asahi-dev · 2022-11-03 18:13
lamlamgpio regs are 4c-64 in the 3rd block (b84XXXX). init/deinit communication uses these. init protocol is done by zeroing out these regs (+ some tunables), to which the anecpu should write back a "magic" number of 0x8042006 in the last gpio.
#asahi-dev · 2022-11-03 18:13
lamlaminit call is a single write32 of 0x10 to the controller after all the dart/vmem mapping/power data stuff. this wfi status is where i was stuck at.
#asahi-dev · 2022-11-03 18:13
lamlamstarting from the first block (b1XXXXX): anecpu bootstraps by writing 10001bfc into L2C_ERR_STS, then L2C_ERR_ADR (26b10008, same mmio range), and then some other HID impls. the 4 regs starting with ce across 16 & 17 are 24hz clocks. the 2nd block (b4XXXXX) is the actual asc base i believe. controller is @ +44 & idle/wfi status @ +48, which is a similar layout to https://github.com/AsahiLinux/docs/wiki/HW:ASC, but none of the vals are.

plus ›