Skip to content

Commit 8d9a798

Browse files
committed
Don't read stacked game/boost clock cells as base == boost
RDNA and Polaris rows put game and boost clocks in one "Core / Clock" cell, and some list only the game clock. Leave base unknown when a cell stacks two clocks, and only copy base into boost for pre-2012 boards.
1 parent 2bae812 commit 8d9a798

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

‎app/ingest/sources/wikipedia_gpu.py‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
# The dataset keeps ATI-branded boards under ``ati``; AMD retired the ATI brand
5353
# in August 2010 and the curated records switch to ``amd`` from October 2010.
5454
_ATI_BRAND_END = date(2010, 10, 1)
55+
# GPU Boost / PowerTune Boost arrived in 2012; before that one core clock is both.
56+
_BOOST_ERA = date(2012, 1, 1)
5557

5658
MEMORY_TYPES = (
5759
"GDDR7", "GDDR6X", "GDDR6", "GDDR5X", "GDDR5", "GDDR4", "GDDR3", "GDDR2",
@@ -301,9 +303,20 @@ def unit(key: str) -> str:
301303
return None
302304

303305
base_clock, range_boost = _clock_mhz(text("base_clock"), unit("base_clock"))
306+
unparenthesized = re.sub(r"\([^)]*\)", "", text("base_clock"))
307+
if range_boost is None and len(re.findall(r"\d+", unparenthesized)) > 1:
308+
# RDNA/Polaris "Core / Clock" cells stack game + boost ("1855 2495"): no base.
309+
base_clock = None
304310
boost_clock = _clock_mhz(text("boost_clock"), unit("boost_clock"))[0] or range_boost
305-
if boost_clock is None and base_clock is not None and "boost_clock" not in cells:
311+
if (
312+
boost_clock is None
313+
and base_clock is not None
314+
and "boost_clock" not in cells
315+
and release_date is not None
316+
and release_date < _BOOST_ERA
317+
):
306318
# Pre-boost boards: the dataset stores boost == base (586/586 pre-2010).
319+
# Later single-clock cells are often a game clock, so they stay unknown.
307320
boost_clock = base_clock
308321

309322
type_width = text("memory_type_width")

‎tests/unit/test_ingest_wikipedia_gpu.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,28 @@ def test_codename_and_bus_helpers() -> None:
9393
assert normalize_bus_interface("AGP 8×") == "AGP 8x"
9494
assert normalize_bus_interface("AGP 4× PCI") == "AGP 4x"
9595
assert normalize_bus_interface("IGP") is None
96+
97+
98+
_RDNA_HTML = """
99+
<table class="wikitable">
100+
<tr><th rowspan="2">Model</th><th rowspan="2">Launch</th><th rowspan="2">Architecture</th>
101+
<th rowspan="2">Bus interface</th><th colspan="2">Core</th><th colspan="3">Memory</th>
102+
<th rowspan="2">TDP</th></tr>
103+
<tr><th>Clock (MHz)</th><th>Config</th><th>Size (GB)</th><th>Bus type</th>
104+
<th>Bus width (bit)</th></tr>
105+
<tr><th>Radeon Pro W7900 Dual Slot</th><td>June 19, 2024</td><td>RDNA 3</td>
106+
<td>PCIe 4.0 ×16</td><td>1855 2495</td><td>6144:384:192</td><td>48</td><td>GDDR6</td>
107+
<td>384</td><td>295 W</td></tr>
108+
<tr><th>Radeon RX 6300M</th><td>January 4, 2022</td><td>RDNA 2</td>
109+
<td>PCIe 4.0 ×4</td><td>1512</td><td>768:48:32</td><td>2</td><td>GDDR6</td>
110+
<td>32</td><td>25 W</td></tr>
111+
</table>
112+
"""
113+
114+
115+
def test_game_clock_cells_do_not_become_base_and_boost() -> None:
116+
page = "List_of_AMD_graphics_processing_units"
117+
cards = {c.slug: c for c in WikipediaGpuIngest._extract(_RDNA_HTML, "amd", page, "")}
118+
assert cards["radeon-pro-w7900-dual-slot"].record["base_clock_mhz"] is None
119+
assert cards["radeon-rx-6300m"].record["boost_clock_mhz"] is None
120+
assert not cards["radeon-rx-6300m"].is_complete

0 commit comments

Comments
 (0)