Bug 1223 - fosdem 2024 bigint presentation (prerecorded)
Summary: fosdem 2024 bigint presentation (prerecorded)
Status: IN_PROGRESS
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Conferences (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Jacob Lifshay
URL: https://pretalx.fosdem.org/fosdem-202...
Depends on:
Blocks: 1070
  Show dependency treegraph
 
Reported: 2023-11-29 00:52 GMT by Jacob Lifshay
Modified: 2024-02-01 06:43 GMT (History)
4 users (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Jacob Lifshay 2023-11-29 00:55:09 GMT
(In reply to Luke Kenneth Casson Leighton from comment #0)
> 7. bug #1223     Big integer - Jacob
>    + Standard long multiply
>    + Carry propagation version

sorry, I don't remember which version of bigint multiply you meant by "carry propagation version" -- did you mean using the carry-propagate instructions or did you mean a carry-save multiply?
Comment 2 Luke Kenneth Casson Leighton 2023-11-29 05:02:26 GMT
(In reply to Jacob Lifshay from comment #1)
> (In reply to Luke Kenneth Casson Leighton from comment #0)
> > 7. bug #1223     Big integer - Jacob
> >    + Standard long multiply
> >    + Carry propagation version
> 
> sorry, I don't remember which version of bigint multiply you meant by "carry
> propagation version" -- did you mean using the carry-propagate instructions
> or did you mean a carry-save multiply?

entirely up to you as long as they demonstrate REMAP capability rather than
are a bland superficial SIMD-i-fi-cation of existing tired (not a spelling
mistake) methods of doing either algorithm

yes this means pulling out the stops and getting ed25529 bigmul powmd
*and the associated REMAP engines completed before FOSDEM*.

which should help you to appreciate why i said to work as fast as you can
to get off of mmap as fast as possible as there is a HELL of a lot to get
done and none of it can be dropped.
Comment 3 Jacob Lifshay 2023-11-29 05:36:41 GMT
(In reply to Luke Kenneth Casson Leighton from comment #2)
> (In reply to Jacob Lifshay from comment #1)
> > (In reply to Luke Kenneth Casson Leighton from comment #0)
> > > 7. bug #1223     Big integer - Jacob
> > >    + Standard long multiply
> > >    + Carry propagation version
> > 
> > sorry, I don't remember which version of bigint multiply you meant by "carry
> > propagation version" -- did you mean using the carry-propagate instructions
> > or did you mean a carry-save multiply?
> 
> entirely up to you as long as they demonstrate REMAP capability rather than
> are a bland superficial SIMD-i-fi-cation of existing tired (not a spelling
> mistake) methods of doing either algorithm

my plan is to demonstrate how bigint*scalar mul using sv.maddedu *without* remap can do 256x64->320-bit multiplications in the backend (also add/sub).

if you want to also demonstrate REMAP-ified bigint mul, fine, but it'll be the second half.

tbh, i don't see the need to demo carry-save multiplication, so i'll just drop that part and consider it replaced with remap bigint mul.
Comment 4 Jacob Lifshay 2023-12-04 22:30:08 GMT
submitted, sorry I was late.
https://pretalx.fosdem.org/fosdem-2024/talk/review/CE7HXCRSKCGX9KDVSLXKEEC3MBQY79AR
Comment 5 Jacob Lifshay 2023-12-06 11:32:31 GMT
well, apparently fosdem doesn't want prerecorded talks (andrey asked):
https://lists.fosdem.org/private/devroom-managers/2023-December/003290.html

so I'll probably just have to cancel this talk.
Comment 6 Luke Kenneth Casson Leighton 2023-12-06 13:05:15 GMT
(In reply to Jacob Lifshay from comment #5)
> well, apparently fosdem doesn't want prerecorded talks (andrey asked):
> https://lists.fosdem.org/private/devroom-managers/2023-December/003290.html
> 
> so I'll probably just have to cancel this talk.

do it anyway it will be valuableand can be uploaded to youtube.
i can assign part f the Eur 4500 to it.
Comment 7 Jacob Lifshay 2023-12-06 20:58:15 GMT
(In reply to Luke Kenneth Casson Leighton from comment #6)
> (In reply to Jacob Lifshay from comment #5)
> > well, apparently fosdem doesn't want prerecorded talks (andrey asked):
> > https://lists.fosdem.org/private/devroom-managers/2023-December/003290.html
> > 
> > so I'll probably just have to cancel this talk.
> 
> do it anyway it will be valuableand can be uploaded to youtube.
> i can assign part f the Eur 4500 to it.

ok, sounds good. I'll withdraw the talk on fosdem's website after you confirm that's good and we can just publish it to youtube and other places (e.g. ipfs).
Comment 8 Luke Kenneth Casson Leighton 2023-12-06 23:47:01 GMT
(In reply to Jacob Lifshay from comment #7)

> ok, sounds good. I'll withdraw the talk on fosdem's website after you
> confirm that's good and we can just publish it to youtube and other places
> (e.g. ipfs).

hold fire on withdraw as someone said "why not do virtual as well"
Comment 9 Jacob Lifshay 2024-01-17 05:40:04 GMT
I'm not at all familiar with latex beamer, or even very familiar with latex for that matter...(it would save me a huge amount of time if I could use libreoffice instead).

that said, here's the initial presentation commit:

https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=543fbc723efdce882dd5bc539a3c9b861625910c

commit 543fbc723efdce882dd5bc539a3c9b861625910c
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Tue Jan 16 21:35:20 2024 -0800

    add initial fosdem 2024 bigint presentation
Comment 10 Luke Kenneth Casson Leighton 2024-01-17 09:23:49 GMT
(In reply to Jacob Lifshay from comment #9)
> I'm not at all familiar with latex beamer, or even very familiar with latex
> for that matter...(it would save me a huge amount of time if I could use
> libreoffice instead).

which will completely overload the wiki due to its massive verbosity.
XML WYSIWYG is completely inappropriate to use here

it's brain-dead simple, cut/paste any of the dozen or so existing
examples, and it is so ridiculously heavily used for such a long time
that google searches immediately find answers.

latex has been around now for appx 40 years.

> https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;
> h=543fbc723efdce882dd5bc539a3c9b861625910c
> 
> commit 543fbc723efdce882dd5bc539a3c9b861625910c
> Author: Jacob Lifshay <programmerjake@gmail.com>
> Date:   Tue Jan 16 21:35:20 2024 -0800
> 
>     add initial fosdem 2024 bigint presentation

fantastic!

one reason for using it is to keep a consistent style but also to
force simplicity.

if you absolutely must go beynd that simplicity and it is wasting time
use another tool (e.g unkscape,svg) rhen convert to png and add both.
use B&W as it gets the image down to 10-15k
Comment 11 Jacob Lifshay 2024-01-17 10:55:57 GMT
(In reply to Luke Kenneth Casson Leighton from comment #10)
> if you absolutely must go beynd that simplicity and it is wasting time
> use another tool (e.g unkscape,svg) rhen convert to png and add both.
> use B&W as it gets the image down to 10-15k

actually, the svg package converts directly to vector graphics according to stack exchange, no need for a png which takes lots of space and/or is low quality and ugly:
https://tex.stackexchange.com/a/523685

the only caveat is you need inkscape installed for that to work.
Comment 12 Luke Kenneth Casson Leighton 2024-01-17 11:16:01 GMT
(In reply to Jacob Lifshay from comment #11)

> the only caveat is you need inkscape installed for that to work.

yep tried it. getting it installed (tex-svg) i managed once,
but not twice. if it works for you and pressing F5 does the job
then absolutely go for it. btw you can just run the manual command
(Makefile) *behind* F5, it is of course... pandoc :)
check tools options.
Comment 13 Jacob Lifshay 2024-01-17 11:19:40 GMT
(In reply to Luke Kenneth Casson Leighton from comment #12)
> (In reply to Jacob Lifshay from comment #11)
> 
> > the only caveat is you need inkscape installed for that to work.
> 
> yep tried it. getting it installed (tex-svg) i managed once,
> but not twice. if it works for you and pressing F5 does the job
> then absolutely go for it.

ah, i'm using a vscode extension, i'll add a makefile later
Comment 14 Luke Kenneth Casson Leighton 2024-01-17 14:47:22 GMT
(In reply to Jacob Lifshay from comment #13)

> ah, i'm using a vscode extension, i'll add a makefile later

if that helps you then go for it, it's not essential at all.
make your life easy ok? :)  latex is pretty damn amazing,
look up the story behind it some time. developed by donald
knuth.
Comment 15 Jacob Lifshay 2024-01-19 08:50:30 GMT
I started on some actual content:
a really short SVP64 intro, how to do bigint add with SVP64, a disclaimer slide, and a WIP slide on how that can run at 256-bits/cycle. there's also a test slide I left at the end that I put there while figuring out how to get latexmk to auto-convert .dia files to .tex

https://git.libre-soc.org/?p=libreriscv.git;a=tree;f=conferences/fosdem2024/fosdem2024_bigint;hb=759c93b3e344284c2afc873aa4a60a17e86ef184

I put the current PDF here:
https://ftp.libre-soc.org/fosdem2024_bigint.pdf

I couldn't put it in the fosdem_2024 folder since luke forgot to change the folder's permissions when he made it, it's owned by root:root instead of ftp:filetransfer
Comment 16 Jacob Lifshay 2024-01-20 00:34:34 GMT
(In reply to Jacob Lifshay from comment #15)
> a WIP slide on how that can run at 256-bits/cycle

fleshed that out some:
https://git.libre-soc.org/?p=libreriscv.git;a=commit;h=b4415717f8b444e7ffa5d4ffbf84f3c9889a8a26

> I put the current PDF here:
> https://ftp.libre-soc.org/fosdem2024_bigint.pdf

updated
Comment 17 Luke Kenneth Casson Leighton 2024-01-20 11:41:13 GMT
(In reply to Jacob Lifshay from comment #15)

> folder's permissions when he made it, it's owned by root:root instead of
> ftp:filetransfer

sorted. looks great. dia... pandoc... don't know. Makefile
converting dia to png?
Comment 18 Jacob Lifshay 2024-01-21 08:44:44 GMT
(In reply to Luke Kenneth Casson Leighton from comment #17)
> sorted. looks great.

Thanks!

> dia... pandoc... don't know.

no pandoc

> Makefile
> converting dia to png?

nope, i added a custom rule to .latexmkrc that uses dia to convert directly to tikz tex. I put it in .latexmkrc instead of Makefile because then it works in the VSCode latex extension with no config required, and also because latexmk will auto-clean intermediate files when you ask it to, it can only do that if it knows what files are intermediate files.
Comment 19 Jacob Lifshay 2024-01-21 08:52:47 GMT
(In reply to Jacob Lifshay from comment #18)
> I put it in .latexmkrc instead of Makefile

to be clear, the Makefile just runs latexmk, so running make in that directory works
Comment 20 Luke Kenneth Casson Leighton 2024-01-21 09:56:29 GMT
(In reply to Jacob Lifshay from comment #18)

> 
> no pandoc

default cmd for texstudio hence why i asked but you have a solution.

> 
> nope, i added a custom rule to .latexmkrc that uses dia to convert directly
> to tikz tex.

nice
Comment 21 Jacob Lifshay 2024-01-30 05:42:57 GMT
making more progress:

I have diagrams showing how data semantically flows through a sv.adde bigint add and through a sv.maddedu scalar-bigint mul -- I tried really hard to show what happens rather than just having a row of boxes with arrows like I do for sv.adde...hope it's not too complex for a slide, there's no space for anything but the diagram on that slide.

I have a diagram showing how fast 256-bit/cycle bigint add could be implemented (preceded by a disclaimer slide), I still need to make a similar diagram for multiplication.

once that's done, I can record the talk, any review/feedback appreciated!

https://git.libre-soc.org/?p=libreriscv.git;a=tree;f=conferences/fosdem2024/fosdem2024_bigint;hb=0cdc9a4724aff056d941297aacb9a5332d3bc320

latest rendered version here:
https://ftp.libre-soc.org/fosdem_2024/fosdem2024_bigint.pdf
Comment 22 Luke Kenneth Casson Leighton 2024-01-30 10:45:41 GMT
(In reply to Jacob Lifshay from comment #21)

> do for sv.adde...hope it's not too complex for a slide, there's no space for
> anything but the diagram on that slide.

perfect, i do that all the time.
> 
> I have a diagram showing how fast 256-bit/cycle bigint add could be
> implemented (preceded by a disclaimer slide), I still need to make a similar
> diagram for multiplication.
> 
> once that's done, I can record the talk, any review/feedback appreciated!

looks brilliant jacob.
do remember to put a closing slide with links to NLnet, EU Grant
number, and website, and if it fits, where the URL is for the
unit test? or just its file name if too long.
Comment 23 Jacob Lifshay 2024-02-01 06:43:25 GMT
commit 304efab0f245f10a30db7986a859f8bf9af32355
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Wed Jan 31 22:38:24 2024 -0800

    fosdem2024_bigint: add end slide
    
    turns out \href is broken when giving it a url with multiple # characters,
    so I had to use \hyperref shenanigans to get it to link to the right url

getting that to work took me like 2hr -- I even tried using pdftex's raw \pdflinkstart command to insert raw PDF source code, but *even that* had escaping problems too!

commit 1986384eda6da23f6f2268910e4cf72f48a5ced8
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Wed Jan 31 20:07:02 2024 -0800

    fosdem2024_bigint: mul pipe diagram completed