Skip to content

Conversation

Jatin-exe
Copy link
Collaborator

Implemented:

  • adds slicing the workloads using the simpointed output
  • builds olympia inside docker.
  • refactor for DockerOrchesterator (host) and run_command on container
  • unfiy redundant functions and remove redundant code
  • adds outputs dir to .gitignore (the output generated from the flow)
  • update yaml spec to include diverse workloads without code changes
  • use an obj file as input for the flow rather than source code.

To do:

  • test qemu simpoint generation plugin
  • performance modelling using olympia
  • more testing with
  • unify with trace-archive

@Jatin-exe Jatin-exe marked this pull request as ready for review September 18, 2025 15:37
@Jatin-exe Jatin-exe changed the title Adding the End to End flow [Draft] Adding the End to End flow Sep 18, 2025

# Create directory structure
RUN mkdir -p /output
RUN mkdir -p /workloads /outputs /workspace $RISCV
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line seems redundant since each folder already has its own WORKDIR command. As for the output directory, it is only used for host system binds, so there is also no need to create it in the dockerfile

DOCKER_IMAGE_NAME = "riscv-perf-model:latest"
DOCKER_TEMP_FOLDER = "/host"
class Const:
DOCKER_IMAGE_NAME = "riscv-perf-model:olympia"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using :olympia doesn’t really follow versioning convention. If you want “olympia” in the image name, it would be better placed before the colon. The part after : is typically reserved for version tags.

- **QEMU**: Generates simple assembly traces using `-d in_asm` output

QEMU cannot generate STF traces - only basic assembly instruction logs.
QEMU can generate STF traces via a plugin (libstfmem), while Spike generates STF natively.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spike doesn’t generate STF traces natively, we use a Condor computing fork of it

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is empty

from flow.utils.paths import BenchmarkPaths, simpoint_analysis_root
from flow.utils.util import CommandError, Util


Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed the TraceGenerator class definition was removed. Was there a specific reason for this change? The original idea behind the class was to make it easier to reuse in other scripts if needed.

single = sub.add_parser("single", help="Generate a single STF trace window")
single.add_argument("binary", help="Path to workload binary")
single.add_argument("--emulator", required=True, choices=["spike", "qemu"])
single.add_argument("--mode", choices=["macro", "insn_count", "pc_count"], default="macro")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why were the mode subparsers removed? Using subparsers helped validate arguments more easily and also made --help output more readable.

except CommandError as err:
Util.warn(f"stf_dump failed: {err}")
return
trace_path.with_suffix(".dump").write_text(dump_result.stdout)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This stf_dump tool part is repeated in the run_single method

) -> subprocess.CompletedProcess:
docker_cmd = self._docker_prefix(workdir, interactive) + ["bash", "-lc", shlex.join(command)]
Util.info("Docker exec: " + " ".join(docker_cmd))
result = subprocess.run(docker_cmd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason the Docker Python library was removed? I found that using it made the code easier to read and maintain.



# output generated by the end to end flow
outputs
Copy link
Collaborator

Choose a reason for hiding this comment

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

I’m not sure if this change affects anything related to the Olympia setup. To be safer, I’d suggest ignoring only the outputs inside the docker stf trace gen folder instead of applying it more broadly.

Util.warn("stf_count not available; skipping verification")
return {"verified": None, "counted": None}
try:
result = Util.run_cmd([str(count_tool), str(trace_path)])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the stf_dump tool. This stf_count should probably be called using the Docker image rather than directly from the host.

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.

2 participants