Files
composable_kernel/tile_engine/sampling/seed.py
Thrupti Raj Lakshmana Gowda c31fc4df52 [rocm-libraries] ROCm/rocm-libraries#7311 (commit 79d8cae)
[CK Tile Engine] Daily tier sampling for tile engine GEMM  (#7311)

Summary
- Replace uniform random instance sampling (random.shuffle) with
scrambled Sobol + Latin Hypercube + maximin space-filling
sampling, per the Tile Engine Benchmark Sampling RFC
- Add op-weighted budget allocation via new
TILE_ENGINE_SAMPLING_TIER=daily CMake knob that auto-distributes 8,000
instances across
ops proportional to registered weights in op_weights.json
  - Emit chosen_instances.json manifests for reproducibility tracking
- Consolidate 5 copies of sampling logic into single _apply_sampling()
method on the base class
Jenkinsfile changes
Replace per-op -D *_MAX_INSTANCES=250 with single -D
TILE_ENGINE_SAMPLING_TIER=daily in gfx942/gfx950/gfx1201 stages. Budget
  auto-distributes (8000 total per GPU target).

---------

Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
2026-05-21 02:17:42 -05:00

25 lines
813 B
Python

# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT
import hashlib
import datetime
def daily_seed(date=None, extra=""):
"""Return sha256(YYYY-MM-DD[:extra]) & 0xFFFFFFFF."""
if date is None:
date = datetime.date.today()
material = date.isoformat()
if extra:
material += f":{extra}"
return int(hashlib.sha256(material.encode()).hexdigest(), 16) & 0xFFFFFFFF
def make_seed(explicit_seed=None, gpu_target="", datatype="", layout=""):
"""If explicit_seed is given, return it. Otherwise compute daily seed
with gpu_target:datatype:layout as extra material."""
if explicit_seed is not None:
return explicit_seed
extra = ":".join(filter(None, [gpu_target, datatype, layout]))
return daily_seed(extra=extra)