Repository navigation
Synchronize concurrent include hashing in Parser - #16
Open
CharlesXu-HQ wants to merge 1 commit into
Open
CharlesXu-HQ wants to merge 1 commit into
CharlesXu-HQ wants to merge 1 commit into
Conversation
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.
Parsershares its include-hash cache and cycle-detection set across calls. Native threads parsing the same tracked header can race on those containers and report a circular include for an acyclic header. This happens beforeRuntimereaches its in-memory cache.Guard both public hashing entry points with one recursive mutex, since recursive include traversal calls between them. The lock covers parsing only; NVCC compilation is outside it. Add an eight-thread regression that starts concurrent parses of the same tracked header and checks every digest.
Validation:
circular include may occur: shared/header.cuhfor an acyclic header. With this change, it passes 10 consecutive rounds.python tests/test_cuda.pysuite passes on an RTX 5090 with CUDA 13.0 and PyTorch 2.9.1+cu130, including the new concurrent parser test, header self-containment checks, and eight-process cache publication tests.git diff --checkpasses.This change synchronizes calls through
Parser's hashing methods. Direct concurrent mutation of its public containers remains unsupported; the separate in-memory cache synchronization is addressed by #12.