Skip to content

mem,dev-amdgpu,tests: support shared pools and MI300X CI - #9

Merged
zevorn merged 4 commits into
gevico/cosim-gpufrom
feature/cosim-shared-pool
Oct 16, 2026
Merged

zevorn merged 4 commits into
gevico/cosim-gpufrom
feature/cosim-shared-pool

Conversation

@zevorn

@zevorn zevorn commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

A supervisor can assign guest RAM and VRAM regions within one shared file.
PhysicalMemory validates and maps those regions while the supervisor retains
file ownership. MI300XVfioUser borrows the VRAM mapping, descriptor, offset and
size from AMDGPUDevice, so BAR access and GPU page walking use the same backing.

The configuration accepts Q35 and ARM64 guest physical maps, including nonzero
RAM file offsets and split ranges. Python annotations support Python 3.8.
Each GPU has its own translation hierarchy, local CU indices and explicit PCI
upstream. BAR4 describes the MSI-X memory region, and GPU 0 owns the fixed
legacy VGA ROM window. Client disconnect removes its poll registration before
normal simulation exit.
GPU-owned POSIX VRAM is unlinked on normal exit. External regular-file pools
remain owned by the supervisor.

The fork has one MI300X CI workflow. It builds VEGA_X86 with vfio-user, checks
source formatting and runs actual model regressions. Other registered workflows
remain disabled. The existing test step installs psutil to inspect live memory
mappings and builds a client against the bundled libvfio-user transport.

Validation from the cosim-gpu workspace:

  • Native ARM64 build through just build-gem5 8.
  • just test-gem5-mi300x <output> exercises Q35/ARM64 maps, nonzero offsets,
    split ranges, RAM after VRAM, pool guards and invalid input rejection.
  • The real client checks exported fd identity, file offset, region size,
    mapped writes read through protocol callbacks, and protocol writes observed
    through the mapping and pool file. Live mapping checks require one owner.
  • The named-memory two-GPU case verifies both listeners, GPU 1 data access,
    GPU 0 isolation, successful server exit after client disconnect and removal
    of owned POSIX memory names.
  • GPU_VIPER protocol regression, actual AArch64 QEMU host connection/cleanup,
    gem5 hooks, commit-message checks and workflow validation.
  • Independent review and focused follow-ups found no required correction.

The tested native ARM64 binary SHA-256 is
b2367fe04bf08a9b0ccfc7af4b9aeeb69e7aaa6138cfb8b194c60a83df788218.

Host integration uses a paused host and covers startup, vfio-user connection,
mapping setup and cleanup. Full Linux guest boot and GPU workloads are outside
this validation. Build/runtime diagnostics include the SystemC architecture
probe, bandwidth units, DRAM geometry, legacy statistics and terminal/timer
notices; raw logs and verdicts are retained in the task artifacts.

Allow PhysicalMemory and System to map bounded regions of an existing
file. Validate page alignment, offsets and file size before mapping.
Leave resizing and removal to the file owner so multiple processes can
share a pool without truncating another region.

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T14:52:58.558609Z beeed84 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60316bd73a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread configs/example/gpufs/mi300_cosim.py Resolved
@zevorn
zevorn force-pushed the feature/cosim-shared-pool branch from f400041 to b982307 Compare October 14, 2026 16:35
@zevorn zevorn changed the title mem,dev-amdgpu,configs: share external cosim memory pools mem,dev-amdgpu,tests: support shared pools and MI300X CI Oct 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60d67da8a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread configs/example/gpufs/mi300_cosim.py Resolved
Comment thread src/dev/amdgpu/MI300XVfioUser.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e523032726

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/dev/amdgpu/amdgpu_device.cc Resolved
Use AMDGPUDevice's PhysicalMemory entry for vfio-user BAR access and GPU
page walking, including externally assigned file offsets. Keep one owner
for the mapping and unlink owned POSIX backing on normal exit while
preserving supervisor-owned pool files.

Remove disconnected client poll registrations before simulation exit and
keep one primary responder for the fixed legacy VGA ROM window.

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Configure assigned RAM and VRAM regions using JSON memory maps, including
nonzero offsets and split ranges. Validate alignment, bounds and overlap,
and retain Q35 defaults for named-memory use.

Keep each GPU's translation hierarchy, compute-unit indices and PCI wiring
local to that device. Configure the bridge through its GPU owner and use
deferred annotations on supported Python interpreters.

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Build VEGA_X86 with vfio-user and reuse the binary for actual MI300X and
GPU_VIPER regressions. Check mapped regions, descriptor ownership,
bidirectional BAR data, multiple GPUs and normal POSIX cleanup. Preserve
externally owned pool files and record complete model diagnostics.

Keep source checks and build caching in the focused workflow. Remove the
generic architecture, compiler and scheduled workflows from this fork.

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
@zevorn
zevorn force-pushed the feature/cosim-shared-pool branch from f11eab1 to beeed84 Compare October 15, 2026 14:48
@zevorn
zevorn merged commit cc9d5dd into gevico/cosim-gpu Oct 16, 2026
@zevorn
zevorn deleted the feature/cosim-shared-pool branch October 16, 2026 03:38
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