Skip to content

Conversation

@laudominik
Copy link
Contributor

In this PR the following changes have been made:

  • FSE decoder now makes requests to RefillingShiftBuffer in bulks
  • FSE decoder sends LITERAL and SEQUENCE commands to SequenceExecutor at the same step
  • dropped uses of logshift{l,r} in FseDecoder, AxiRamReader and ShiftBuffer

@laudominik laudominik changed the title FSE decoding performance improvements for ZSTD FSE decoding improvements in ZSTD Aug 26, 2025
@dplassgit
Copy link
Contributor

Is this ready for review?

@tmichalak
Copy link

@dplassgit yes it is.

@dplassgit dplassgit self-requested a review September 5, 2025 13:16
Copy link
Contributor

@dplassgit dplassgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval with request for reformatting.

) {
let (cmd_s, cmd_r) = chan<FseDecoderCommandReq, u32:1>("fse_dec_cmd_req");

spawn FseDecoderCommand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny formatting here, and other places int his file. You should be able to format with the command line tool.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reformatted the code as requested

@dplassgit
Copy link
Contributor

dplassgit commented Sep 9, 2025

Looks like zstd_dec_dslx_test is failing:

xls/modules/zstd/zstd_dec.x:246:26-246:37
0244:         let tok0 = join();
0245: 
0246:         const CSR_REQS = CsrRdReq[2]:[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^---------^ TypeInferenceError: CsrRdReq { csr: uN[LOG2_REGS_N] }[2] Annotated type for array literal must be constexpr; type has dimensions that cannot be resolved.
0247:             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::INPUT_BUFFER)},
0248:             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::OUTPUT_BUFFER)}

@rw1nkler rw1nkler force-pushed the zstd_dec_performance_github_pr branch from 92178c4 to 2cfc588 Compare September 10, 2025 09:18
rw1nkler and others added 5 commits September 10, 2025 11:20
…mmit desc

Co-autored-by: Dominik Lau <[email protected]>
Signed-off-by: Robert Winkler <[email protected]>
This change was introduced as a workaround for malfunctioning proc-scoped type aliases

Signed-off-by: Robert Winkler <[email protected]>
@rw1nkler rw1nkler force-pushed the zstd_dec_performance_github_pr branch from 2cfc588 to c9582db Compare September 10, 2025 09:22
@rw1nkler
Copy link
Contributor

This is interesting. It looks like the proc-scoped type is treated in different way than a local type alias, because the error disappears after redefining the type in the next's body:

diff --git a/xls/modules/zstd/zstd_dec.x b/xls/modules/zstd/zstd_dec.x
index a68ed6514..11af2a7fc 100644
--- a/xls/modules/zstd/zstd_dec.x
+++ b/xls/modules/zstd/zstd_dec.x
@@ -243,6 +243,7 @@ proc ZstdDecoderInternal<
     next (state: State) {
         let tok0 = join();

+        type CsrRdReq = csr_config::CsrRdReq<LOG2_REGS_N>;
         const CSR_REQS = CsrRdReq[2]:[
             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::INPUT_BUFFER)},
             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::OUTPUT_BUFFER)}

or after referencing the type without the proc-scoped alias:

diff --git a/xls/modules/zstd/zstd_dec.x b/xls/modules/zstd/zstd_dec.x
index a68ed6514..d22927ad3 100644
--- a/xls/modules/zstd/zstd_dec.x
+++ b/xls/modules/zstd/zstd_dec.x
@@ -243,7 +243,7 @@ proc ZstdDecoderInternal<
     next (state: State) {
         let tok0 = join();

-        const CSR_REQS = CsrRdReq[2]:[
+        const CSR_REQS = csr_config::CsrRdReq<LOG2_REGS_N>[2]:[
             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::INPUT_BUFFER)},
             CsrRdReq {csr: csr<LOG2_REGS_N>(Csr::OUTPUT_BUFFER)}
         ];

@rw1nkler
Copy link
Contributor

Superseded by #3034

@tmichalak
Copy link

@proppy @dplassgit since #3034 got merged this one can be closed.

@dplassgit
Copy link
Contributor

Closed since #3034 supersedes it and is merged.

@dplassgit dplassgit closed this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants