Spatz mxcore - #326
Conversation
…lective GEMV kernel to spatz test.
It causes DM core to enter wfi and other cores hang in the barrier (deadlock).
colluca
left a comment
There was a problem hiding this comment.
Apart from the minor comments/changes that follow, I think we should make one more major change, specifically in the integration of the software.
While this could potentially become a huge effort, to keep it reasonable I would aim only for the following two points:
- Instead of a separate
sw/spatzfolder, move its contents respectively to thesw/runtimedirectory and to the subdirectories ofsw/kernels. If a specific kernel already exists, there is no need to merge the original and the Spatz version, at this stage. Let's simply keep two adjacent directories, e.g. axpy and spatz_axpy. - Ideally we should align with the data generation and verification infrastructure used by the other kernels. In the case of different implementations of the same kernel, e.g. axpy and spatz_axpy, to avoid copy-pasting the same scripts around we can symlink them.
| # Spatz package generation via the Spatz hw/Makefile flow: | ||
| # import_cfg.py extracts Spatz VFU fields from the cluster config, | ||
| # apply_cfg.py renders spatz_pkg.sv.tpl into the generated file. | ||
| $(SPATZ_PKG): $(SN_CFG) $(SPATZ_PKG_TPL) | $(SN_GEN_DIR) | ||
| @echo "[SPATZ] Generating $@" | ||
| cd $(SPATZ_HW_DIR) && python import_cfg.py $(abspath $(SN_CFG)) | ||
| cd $(SPATZ_HW_DIR) && python apply_cfg.py $(basename $(notdir $(SN_CFG))) | ||
| cp $(SPATZ_HW_DIR)/src/generated/spatz_pkg.sv $@ | ||
|
|
There was a problem hiding this comment.
Ideally, one would extend the generation script to:
- enable invoking from any working directory, and
- override the path where the output is to be generated.
These are merely suggestions, not strictly needed for this PR.
But particularly the latter is a safety feature that can avoid future headaches, e.g. if you're working on Spatz and the cluster simultaneously, and don't want that reconfiguring Spatz in the cluster repo overwrites the file in the Spatz repo, potentially affecting the parallel work on Spatz.
colluca
left a comment
There was a problem hiding this comment.
One more question which just came to my mind, why exactly do we need riscv_instr.sv in Snitch to include the vector instructions if we are not decoding them here?
Similarly, why do we need to use Snitch's riscv_instr.sv instead of Spatz' own file, within Spatz?
Or is the issue simply that we can't compile two packages with the same name or something like that?
Because currently this file overwrites the one in spatz_vpu, and Spatz's decoder needs to decode these instructions. And the one in Spatz does not contain some features snitch cluster needed, e.g. SSR, post-increment |
What I mean to ask is: what goes wrong when each repo has its own riscv_instr.sv file and no override is done (either through Bender or manually copying the file)? Does Snitch's file end up taking precedence during compilation such that also Spatz picks it up? Is that what you mean by "overwrites"? And if so, how is that a problem if manually overwriting Spatz' file we are achieving the same? The only condition in which I see issues is if Spatz' overwrites Snitch's during compilation. |
I think this is what happens in Gwaihir that Spatz' riscv_instr.sv is compiled later and override Snitch's during compilation |
Okay, this is what we need to clarify. I believe Bender determines the compilation order according to the dependency DAG, so what you say shouldn't be the case. But I think the way Bender is used in Gwaihir is for it to produce a single compilation command. In that case, probably it can't handle name conflicts (e.g. multiple packages with the same name), and it might be that it filters out all but the first file with the same basename. If this is the correct explanation, then the best solution would just be to namespace the |
…p_interface and snitch" This reverts commit 4c11039.
508ddc9 to
d53634d
Compare
HW
snitch_tracermodulesnitch_ssr_subsystemmodulereqrsp_demux_mappedmodulereqrsp_interfaceinterface was effectively an LSU interface. Separate and rename this interface tolsu_interface.reqrsp_interfaceproper is now an abstract interface, from which different concrete reqrsp interfaces can be created (e.g.dca_interface,fpu_interface,lsu_interface, etc.)tcdm_interfaceandmem_interfacebased entirely on genericreqrsp_interfacehart_id_tfromsnitch_cluster_pkgtosnitch_pkgriscv_instrtosnitch_riscv_instrto prevent name conflictsreqrsp_interfaceand LSU IP/interface to dedicated repos. Allows to break the circular snitch_cluster → spatz → snitch_cluster(for LSU and reqrsp_interface) dependency, which now becomes snitch_cluster → spatz → LSU/reqrsp_interfaceSW
snrt_global_all_to_all_reductionif there is more than one clusterdata_utilsSNRT_SUPPORTS_SMALLFLOATguard on naive FP16 GEMMMake
DEBUG=ONfor enabling traces withTRACE=OFFfor disabling them (on by default). This allows to run performance experiments without having to run the simulation with+acc.toolchain.mkand derive toolchain flags directly from cluster configuration (SN_MCPUflag thus becomes obsolete)toolchain.mkhas to have been built and read before the bootrom generation targets can be evaluatedtoolchain.mkadditionCI
explicit-parameter-storage-typeinriscv_instr.svbase-shajob to pick up the upstream main branch even on forksmake-prerequisites-changedaction to fix undetected file changes (see Convert prerequisites to workspace-relative paths before diffing colluca/make-prerequisites-changed#1)Misc
TODO