Enabled Weighted Sampling#635
Draft
mkolodner-sc wants to merge 6 commits into
Draft
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.
Summary
Adds native weighted edge sampling to GiGL's distributed training pipeline via GLT's
CPUWeightedSampler. When enabled, neighbors are sampled proportionally to edge weights rather than uniformly.New API
DistPartitioner.register_edge_weights(edge_weights)— registers a 1D per-edge weight tensor (homogeneous ordict[EdgeType, Tensor]for heterogeneous) before callingpartition_edge_index_and_edge_features(). Weights are partitioned alongside edge features in the same pass (co-partitioned, mirroring the node features + labels pattern).build_dataset(weight_edge_feat_name=...)— accepts the name of an existing edge feature column to use as weights. The column is sliced out and removed from the feature tensor before registration, so it is never duplicated in memory.DistNeighborLoader(with_weight=True)/DistABLPLoader(with_weight=True)— enables weighted sampling. Defaults toFalse; must be set explicitly.BaseDistLoader.validate_with_weight()— shared validation: raisesValueErrorifwith_weight=Truebut no weights are registered in the dataset; raisesNotImplementedErrorif used withPPRSamplerOptions(weight-proportional PPR residual propagation is deferred to a future PR).Implementation notes
GraphPartitionData.weights(field already existed) carries the partitioned weight tensor toDistDataset._initialize_graph(), which forwards it to GLT'sinit_graph(edge_weights=...).DistDataset.has_edge_weightsproperty reflects whether weights were registered at construction time.SamplingConfig.with_weightis now threaded through from the loader rather than hardcoded toFalse.Tests
New test file
tests/unit/distributed/distributed_weighted_sampling_test.pywith 8 tests:GraphPartitionData.edge_ids == FeaturePartitionData.ids), and heterogeneous partial weights (one edge type weighted, another not).