Skip to content

fix: resolve #95 — Add Regular (cached) pinned memory allocation strategy#213

Open
ed-thuando wants to merge 2 commits into
novitalabs:masterfrom
ed-thuando:contribai/feat/core-allocation-strategy-implementation
Open

fix: resolve #95 — Add Regular (cached) pinned memory allocation strategy#213
ed-thuando wants to merge 2 commits into
novitalabs:masterfrom
ed-thuando:contribai/feat/core-allocation-strategy-implementation

Conversation

@ed-thuando

Copy link
Copy Markdown

Summary

fix: resolve #95 — Add Regular (cached) pinned memory allocation strategy

Problem

Severity: High | File: pegaflow-core/src/pinned_mem.rs

Contains the AllocStrategy enum and PinnedMemory::allocate function. Currently has WriteCombined and HugePages variants. Need to add Regular variant that uses cudaHostAllocDefault for bidirectional workloads where CPU cache matters.

Solution

Add Regular variant to AllocStrategy enum and update the allocate function to handle the new variant by calling cudaHostAllocDefault instead of cudaHostAllocWriteCombined or mmap with MAP_HUGETLB.

Changes

  • pegaflow-core/src/pinned_mem.rs (modified)
  • pegaflow-core/src/pinned_pool.rs (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Generated by ContribAI v6.0.0

…ation strategy

Fixes novitalabs#95

Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com>
…ation strategy

Fixes novitalabs#95

Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com>
}
}
}
}l(size: usize, strategy: AllocStrategy) -> Result<Self, PinnedMemError> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what's this?

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.

Add Regular (cached) pinned memory allocation strategy

2 participants