Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Simulations are like miniskirts, they show a lot and hide the essentials. -- Hubert Kirrman


devel / comp.lang.forth / Re: Eliminating FDUP F*, numerical analysis, posit

SubjectAuthor
* Eliminating FDUP F*Krishna Myneni
+* Re: Eliminating FDUP F*minforth
|+* Re: Eliminating FDUP F*mhx
||+- Re: Eliminating FDUP F*minforth
||`- Re: Eliminating FDUP F*none
|`* Re: Eliminating FDUP F*Krishna Myneni
| `* Re: Eliminating FDUP F*minforth
|  `* Re: Eliminating FDUP F*Krishna Myneni
|   `* Re: Eliminating FDUP F*minforth
|    +* Re: Eliminating FDUP F*Anton Ertl
|    |+- Re: Eliminating FDUP F*minforth
|    |`* Re: Eliminating FDUP F*none
|    | `* Re: Eliminating FDUP F*Anton Ertl
|    |  +* Re: Eliminating FDUP F*minforth
|    |  |`* Re: Eliminating FDUP F*Anton Ertl
|    |  | `* Re: Eliminating FDUP F*minforth
|    |  |  +* Re: Eliminating FDUP F*none
|    |  |  |+- Re: Eliminating FDUP F*minforth
|    |  |  |`* Re: Eliminating FDUP F*Anton Ertl
|    |  |  | +* Re: Eliminating FDUP F*mhx
|    |  |  | |`* Re: Eliminating FDUP F*Anton Ertl
|    |  |  | | +* Re: Eliminating FDUP F*mhx
|    |  |  | | |`- Re: Eliminating FDUP F*Anton Ertl
|    |  |  | | `* Re: Eliminating FDUP F*, numerical analysisjan Coombs
|    |  |  | |  +* Re: Eliminating FDUP F*, numerical analysisminforth
|    |  |  | |  |+* Re: Eliminating FDUP F*, numerical analysisnone
|    |  |  | |  ||`- Re: Eliminating FDUP F*, numerical analysisminforth
|    |  |  | |  |`- Re: Eliminating FDUP F*, numerical analysis, positJan Coombs
|    |  |  | |  `* Re: Eliminating FDUP F*, numerical analysisAnton Ertl
|    |  |  | |   +- Re: Eliminating FDUP F*, numerical analysisminforth
|    |  |  | |   `- Re: Eliminating FDUP F*, numerical analysisjan Coombs
|    |  |  | `- Re: Eliminating FDUP F*none
|    |  |  `- Re: Eliminating FDUP F*Anton Ertl
|    |  `* Re: Eliminating FDUP F*none
|    |   +* Re: Eliminating FDUP F*mhx
|    |   |`* Re: Eliminating FDUP F*Anton Ertl
|    |   | `* Re: Eliminating FDUP F*none
|    |   |  `- Re: Eliminating FDUP F*Anton Ertl
|    |   `- Re: Eliminating FDUP F*Anton Ertl
|    `* Re: Eliminating FDUP F*Krishna Myneni
|     `* Re: Eliminating FDUP F*Anton Ertl
|      `- Re: Eliminating FDUP F*Krishna Myneni
`* Re: Eliminating FDUP F*minforth
 +* Re: Eliminating FDUP F*dxf
 |`* Re: Eliminating FDUP F*Krishna Myneni
 | +- Re: Eliminating FDUP F*dxf
 | `* Re: Eliminating FDUP F*mhx
 |  +- Re: Eliminating FDUP F*none
 |  `- Re: Eliminating FDUP F*Krishna Myneni
 +* Re: Eliminating FDUP F*Krishna Myneni
 |`* Re: Eliminating FDUP F*minforth
 | `* Re: Eliminating FDUP F*Krishna Myneni
 |  `* Re: Eliminating FDUP F*minforth
 |   `- Re: Eliminating FDUP F*dxf
 `- Re: Eliminating FDUP F*none

Pages:123
Re: Eliminating FDUP F*

<ul9p1l$3m846$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25609&group=comp.lang.forth#25609

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: krishna.myneni@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Eliminating FDUP F*
Date: Tue, 12 Dec 2023 08:00:19 -0600
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <ul9p1l$3m846$1@dont-email.me>
References: <uk7eb0$rni9$1@dont-email.me>
<743d2d729862d0b2fb9ff9ce314935dd@news.novabbs.com>
<ul8bp3$3ccrl$1@dont-email.me> <ul8e6m$3cnqn$2@dont-email.me>
<a23e7f246a3ab1c5d76d263804ebec69@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 14:00:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dd50babf4b1212511b244e2957dccddc";
logging-data="3874950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188x/99hf0Zx5WjewSdgMWa"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:hHZf9fCeQHLAM5gTTfHQzCuZIhI=
Content-Language: en-US
In-Reply-To: <a23e7f246a3ab1c5d76d263804ebec69@news.novabbs.com>
 by: Krishna Myneni - Tue, 12 Dec 2023 14:00 UTC

On 12/12/23 02:49, mhx wrote:
> Krishna Myneni wrote:
>
>> The flocals implementation in the FSL is substantially worse. Unlike
>> using fp stack operations, one can't write re-entrant words with the
>> FSL implementation of flocals.
>
> I don't understand. This should be awkward, but ok?
>
> 8 CONSTANT /flocals
>
> : (frame) ( n -- ) FLOATS ALLOT ;
>
> : FRAME|
>        0 >R
>        BEGIN   BL WORD  COUNT  1 =
>                SWAP C@  [CHAR] | =
>                AND 0=
>        WHILE   POSTPONE F,  R> 1+ >R
>        REPEAT
>        /FLOCALS R> - DUP 0< ABORT" too many flocals"
>        POSTPONE LITERAL  POSTPONE (frame) ; IMMEDIATE
>
> : |FRAME ( -- ) [ /FLOCALS NEGATE ] LITERAL (FRAME) ;
>
> : &h            HERE [ 1 FLOATS ] LITERAL - ;
> : &g            HERE [ 2 FLOATS ] LITERAL - ;
> : &f            HERE [ 3 FLOATS ] LITERAL - ;
> : &e            HERE [ 4 FLOATS ] LITERAL - ;
> : &d            HERE [ 5 FLOATS ] LITERAL - ;
> : &c            HERE [ 6 FLOATS ] LITERAL - ;
> : &b            HERE [ 7 FLOATS ] LITERAL - ;
> : &a            HERE [ 8 FLOATS ] LITERAL - ;
>
> : a             &a F@ ;
> : b             &b F@ ;
> : c             &c F@ ;
> : d             &d F@ ;
> : e             &e F@ ;
> : f             &f F@ ;
> : g             &g F@ ;
> : h             &h F@ ;
>

The above looks ok. It has been a while since I looked at this code. The
implementation above allots space each time for new locals on entry and
frees it on exit -- I seem to be wrong about the FSL implementation
killing re-entrancy.

--
Krishna

Re: Eliminating FDUP F*

<ulb1f2$3sepv$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25610&group=comp.lang.forth#25610

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: krishna.myneni@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Eliminating FDUP F*
Date: Tue, 12 Dec 2023 19:30:10 -0600
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <ulb1f2$3sepv$1@dont-email.me>
References: <uk7eb0$rni9$1@dont-email.me>
<743d2d729862d0b2fb9ff9ce314935dd@news.novabbs.com>
<ul8duh$3cnqn$1@dont-email.me>
<df61d062cd70fb93131a5657aa65e2c1@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 13 Dec 2023 01:30:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ddb8fcb1e692a1e5611ec4b7b83dc011";
logging-data="4078399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+u+ZYNrHdijIfMUYGYBYVb"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:PqJ3lfzA47kPG7CuPeTXmW2H1GM=
In-Reply-To: <df61d062cd70fb93131a5657aa65e2c1@news.novabbs.com>
Content-Language: en-US
 by: Krishna Myneni - Wed, 13 Dec 2023 01:30 UTC

On 12/12/23 01:00, minforth wrote:
> Krishna Myneni wrote:
>> On 12/11/23 16:42, minforth wrote:
>>> Standard Forth only defines a reduced number of fp stack operations.
>>> I added
>>> FPICK (like PICK) FROLL (like ROLL)
>>> -FROLL (like ROLL reversed)
>>> F>R R>F (already discussed)
>>> Of course this only works if the FP stack is fully accessible e.g.
>>> memory mapped.
>
>> Yes, I have added FPICK as an intrinsic word in kForth-64, and have
>> source definitions of F>R and FR> (your R>F, which is actually a
>> better name). But I think FRISE may reduce/eliminate the need for F>R
>> etc. When the FP stack resides in memory and can be accessed using a
>> pointer, it's easy to implement FRISE in source to assess its usefulness.
>
> You have defined RISE as in  2 RISE  i*x a b c d -- i*x b a c d et cetera
>
> I don't really have an application where a position swap in the depths
> of the stack would fit, because Forth operations always only use the
> top stack element(s).
>
> Then rather something like in
>  2 FLIP   i*x a b c d -- d b c a

The depth 2 RISE/FRISE would provide the function I was originally
asking for, but the general version is similar to FPICK. Admittedly,
whether the general FRISE has application for other depths remains to be
seen. Perhaps an on-fpstack sorting routine?

--
Krishna

Re: Eliminating FDUP F*

<dbd9053eda3f91ffc45f3c7faf335b3d@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25611&group=comp.lang.forth#25611

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: Eliminating FDUP F*
Date: Wed, 13 Dec 2023 08:43:35 +0000
Organization: novaBBS
Message-ID: <dbd9053eda3f91ffc45f3c7faf335b3d@news.novabbs.com>
References: <uk7eb0$rni9$1@dont-email.me> <743d2d729862d0b2fb9ff9ce314935dd@news.novabbs.com> <ul8duh$3cnqn$1@dont-email.me> <df61d062cd70fb93131a5657aa65e2c1@news.novabbs.com> <ulb1f2$3sepv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3963950"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
X-Rslight-Site: $2y$10$1Wc6rvWuBmL3Kz4G1hZ24.aFSECC4iULR37tBC51SVrgA3ajobefW
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: minforth - Wed, 13 Dec 2023 08:43 UTC

Krishna Myneni wrote:
> The depth 2 RISE/FRISE would provide the function I was originally
> asking for, but the general version is similar to FPICK. Admittedly,
> whether the general FRISE has application for other depths remains to be
> seen.

For similar reasons I used to have a word called PATCH as a counterpart
to PICK: n PATCH overwrote the stack value in depth n, often handy to avoid
ROLLs. But in the end, such words are just crutches if you don't have locals.

> Perhaps an on-fpstack sorting routine?

Yeah, brings order to chaos ;o)

Re: Eliminating FDUP F*

<ulbvur$40ad$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25612&group=comp.lang.forth#25612

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: Eliminating FDUP F*
Date: Wed, 13 Dec 2023 21:10:35 +1100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <ulbvur$40ad$1@dont-email.me>
References: <uk7eb0$rni9$1@dont-email.me>
<743d2d729862d0b2fb9ff9ce314935dd@news.novabbs.com>
<ul8duh$3cnqn$1@dont-email.me>
<df61d062cd70fb93131a5657aa65e2c1@news.novabbs.com>
<ulb1f2$3sepv$1@dont-email.me>
<dbd9053eda3f91ffc45f3c7faf335b3d@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 13 Dec 2023 10:10:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="bae709757078a76f0673a1c8e6d52b5e";
logging-data="131405"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/updfuJlzVrxV7r9fcB87Q"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:y9p6U4YtkOzDSkiqAotkf2kw3r0=
Content-Language: en-GB
In-Reply-To: <dbd9053eda3f91ffc45f3c7faf335b3d@news.novabbs.com>
 by: dxf - Wed, 13 Dec 2023 10:10 UTC

On 13/12/2023 7:43 pm, minforth wrote:
> Krishna Myneni wrote:
>> The depth 2 RISE/FRISE would provide the function I was originally asking for, but the general version is similar to FPICK. Admittedly, whether the general FRISE has application for other depths remains to be seen.
>
> For similar reasons I used to have a word called PATCH as a counterpart
> to PICK: n PATCH overwrote the stack value in depth n, often handy to avoid
> ROLLs. But in the end, such words are just crutches if you don't have locals.  

If forth be a crutch, throw it away and use something else.

Re: Eliminating FDUP F*, numerical analysis, posit

<20231215153001.4e6c05b0@t530>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25629&group=comp.lang.forth#25629

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jenfhaomndgfwutc@murmic.plus.com (Jan Coombs)
Newsgroups: comp.lang.forth
Subject: Re: Eliminating FDUP F*, numerical analysis, posit
Date: Fri, 15 Dec 2023 15:30:01 +0000
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <20231215153001.4e6c05b0@t530>
References: <uk7eb0$rni9$1@dont-email.me>
<9198892c8c20bea6f1d90ee7df9c8f76@news.novabbs.com>
<2023Dec3.151859@mips.complang.tuwien.ac.at>
<e93ff88202425b32916bae8123adf0b2@news.novabbs.com>
<nnd$74756098$55743a7b@a5a58826f7151fa5>
<2023Dec3.192306@mips.complang.tuwien.ac.at>
<fc20dfd66efb80f7a6f1c76db2883704@news.novabbs.com>
<2023Dec5.093701@mips.complang.tuwien.ac.at>
<20231205120801.1c1da051@t530>
<37830e4e5246f79b7d97247e4a973b1a@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="62009baf926fa4ddc3af7ad06dafa718";
logging-data="1958603"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vsssMxPTnMIgdrfs/Kx2Z58ujWw9wN+U="
Cancel-Lock: sha1:aSDck++1Rk50pjXj4rvw5YQdDPw=
X-Newsreader: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
 by: Jan Coombs - Fri, 15 Dec 2023 15:30 UTC

On Tue, 5 Dec 2023 12:52:36 +0000
minforth@gmx.net (minforth) wrote:

[about floats with improved performance]
> Thanks for mentioning this. There is indeed a need for reduced, adaptable
> fp formats, especially in AI systems. See also the 'Motivation' section in
> https://github.com/stillwater-sc/universal
Thanks, have added that to my reference docs.

> There are already some experimental libraries using unum posits for various
> programming languages. Is there any Forth code that uses unums?

A quick route would be to buy a processor with posits[1] built-in, and install
Forth. I thought RISC-V ones were available, but looking now only found a
prototype[2], product announcement[3], and available HW designs.[4][5]

Jan Coombs
--

[1] Posits, a New Kind of Number, Improves the Math of AI The first posit-
based processor core gave a ten-thousandfold accuracy boost
https://spectrum.ieee.org/floating-point-numbers-posits-processor

[2] Researchers Build a RISC-V Chip That Calculates in Posits, Boosting
Accuracy for ML Workloads
https://www.hackster.io/news/researchers-build-a-risc-v-chip-that-calculates-in-posits-boosting-accuracy-for-ml-workloads-086b985bf0c1

[3] A Lightweight Posit Processing Unit for RISC-V Processors in Deep Neural
Network Applications
https://riscv.org/news/2021/10/a-lightweight-posit-processing-unit-for-risc-v-processors-in-deep-neural-network-applications-marco-cococcioni-federico-rossi-emanuele-ruffaldi-and-saponara-sergio-ieee-transactions-on-emerging/

[4] PERI: A Configurable Posit Enabled RISC-V Core
https://dl.acm.org/doi/fullHtml/10.1145/3446210

[5] PERCIVAL: Open-Source Posit RISC-V Core with Quire Capability
https://arxiv.org/abs/2111.15286

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor