|
29 | 29 | "gplus", |
30 | 30 | "synthetic_contiguous", |
31 | 31 | "synthetic_offset", |
| 32 | + "synthetic_string_offset", |
| 33 | + "synthetic_string_gplus_shape", |
32 | 34 | ] |
33 | 35 |
|
34 | 36 | STRATEGY_CHOICES = [ |
|
41 | 43 | ] |
42 | 44 |
|
43 | 45 |
|
| 46 | +GPLUS_SHAPE_VERTICES = 107_614 |
| 47 | + |
| 48 | + |
44 | 49 | def ensure_cached(dataset: str, data_dir: Path) -> Path: |
45 | 50 | spec = dataset_spec(dataset) |
46 | 51 | path = data_dir / str(spec["filename"]) |
@@ -103,16 +108,29 @@ def strategy_skip_reason(strategy: str, profile: Dict[str, object]) -> str | Non |
103 | 108 |
|
104 | 109 | def build_synthetic_edges(graph_kind: str, edge_count: int): |
105 | 110 | import cudf # type: ignore |
| 111 | + import cupy as cp # type: ignore |
| 112 | + |
| 113 | + if graph_kind == "synthetic_string_gplus_shape": |
| 114 | + start = 1_000_000 |
| 115 | + base = cudf.Series(cp.arange(edge_count, dtype=cp.int32) % cp.int32(GPLUS_SHAPE_VERTICES)) |
| 116 | + src = (base + start).astype("int32").astype("str") |
| 117 | + dst = ((base + 1) % GPLUS_SHAPE_VERTICES + start).astype("int32").astype("str") |
| 118 | + return cudf.DataFrame({"src": src, "dst": dst}) |
106 | 119 |
|
107 | 120 | if graph_kind == "synthetic_contiguous": |
108 | 121 | start = 0 |
109 | 122 | elif graph_kind == "synthetic_offset": |
110 | 123 | start = 1_000_000 |
| 124 | + elif graph_kind == "synthetic_string_offset": |
| 125 | + start = 1_000_000 |
111 | 126 | else: |
112 | 127 | raise ValueError(f"Unsupported synthetic graph kind: {graph_kind}") |
113 | 128 |
|
114 | 129 | src = cudf.Series(range(start, start + edge_count), dtype="int32") |
115 | 130 | dst = cudf.Series(range(start + 1, start + edge_count + 1), dtype="int32") |
| 131 | + if graph_kind == "synthetic_string_offset": |
| 132 | + src = src.astype("str") |
| 133 | + dst = dst.astype("str") |
116 | 134 | return cudf.DataFrame({"src": src, "dst": dst}) |
117 | 135 |
|
118 | 136 |
|
|
0 commit comments