Conversation
- Add uint8_t *dev_hs_states_ member for GPU HS state storage - Add bool hs_gpu_enabled_ flag for allocation tracking - Add dev_global_params_ and gp_count_ for kernel parameter passing - Implement allocateHSGPU(): lazy allocation with cudaMalloc, init to HS1 - Implement freeHSGPU(): proper cleanup with cudaFree - Implement resetHSGPU(): restore all states to HS1 via cudaMemset - Implement getDevHSStates(): accessor for kernel use - Update destructor to call freeHSGPU() preventing memory leaks - Update copy constructor for deep-copy of HS states - Update move assignment for ownership transfer - Update swap function to handle HS members - Override getGlobalParamsData() to return global params when available Memory layout: d_size * x_size uint8_t values, initialized to HS1 (value=1) Global params infrastructure: ready for [write_noise_std, hs_decay] encoding Pattern: follows dev_persistent_weights_ allocation strategy Ref: Task 4 from aihwkit-hs-cuda plan
- Add PulseType::HalfselectedStochastic and PulseType::HalfselectedStochasticStream as case labels in makeCounts() switch statement - Both variants alias to existing StochasticCompressed logic - Pulse generation is identical; difference is only in kernel dispatch after BLM - Follows CPU SparseBLM pattern for HS variant handling - Prevents RPU_FATAL crash when creating tile with HS PulseType on CUDA
Add half-select-aware pulsed update to the RPU simulator: - New PulseType variants HALFSELECTED_STOCHASTIC / HALFSELECTED_STOCHASTIC_STREAM (Python enum + C++ meta parameter), plus STOCHASTIC_STREAM support. - HS state tracking on PulsedRPUDevice (CPU) and PulsedRPUDeviceCuda (GPU), with hs_decay parameter on ConstantStepDevice and transition-count readout exposed via enable_hs_tracking() / get_hs_transition_counts(). - CPU: SparseBitLineMaker and weight updater apply HS decay on half-selected cells; CUDA: pwu_kernel_hs.h kernels wired into constant-step and linear-step device updates. - Tests: tests/test_hs_state_tracking.cpp, tests/test_hs_training_cpu.py, tests/test_hs_verify.py. Examples 01-03 updated to exercise HS pulse types. - CUDA_HS_BUILD.md documents building/verifying HS on GPU (WSL2, sm_75). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
|
Hello @Minsikc can you give us some context and explanation on the PR description about your changes? Thanks! |
PabloCarmona
self-requested a review
August 25, 2026 10:50
Collaborator
|
@Minsikc could you update the PR with info about what is does, how and some details? This PR changes a lot of files specially the core of the sdk: CUDA and C++ source code. If we don't get any update on this we will close the PR. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Description
Details