Add no-op platform implementations for dry-run testing#113
Merged
Jack-Khuu merged 4 commits intoplatform/registryfrom Mar 3, 2026
Merged
Add no-op platform implementations for dry-run testing#113Jack-Khuu merged 4 commits intoplatform/registryfrom
Jack-Khuu merged 4 commits intoplatform/registryfrom
Conversation
No-op implementations pass the input kernel through unchanged, useful for CI environments without GPU hardware and integration tests. - noop.py: NoOpVerifier (returns True), NoOpBenchmarker (returns 1.0ms placeholder), NoOpWorkerRunner (returns parent kernel as success), plus worker-level stubs (NoOpSpecsProvider, NoOpProfiler, NoOpRooflineAnalyzer, NoOpBottleneckAnalyzer, NoOpRAGPrescriber). - registry.py: register all noop implementations under "noop" name. - __init__.py: re-export noop classes. - examples/configs/noop.yaml: greedy strategy with platform: noop.
- Add gpu_name and other worker kwargs to the --config path in run_opt_manager.py (were always passed in hardcoded paths). - Fix openai_model inconsistency across YAML configs. - Pass profiling_semaphore to fallback KernelProfiler construction so NCU profiling is properly serialized.
When a decorated function has **kwargs, apply_defaults() stores them
as {param_name: {}} in bound_args.arguments. Calling func(**result)
then passes that as a keyword arg, nesting it inside the real **kwargs.
Expand VAR_KEYWORD entries before returning so they stay flat.
Contributor
Author
|
Note that the changes in this PR are fairly trivial (just the first commit), but this PR also has the forward fix for the stack |
Laurawly
approved these changes
Mar 3, 2026
Jack-Khuu
added a commit
that referenced
this pull request
Mar 3, 2026
…d no-op platform implementations for dry-run testing (#113) * Add platform component registry for config-driven selection Introduce PlatformRegistry that maps (component_key, impl_name) pairs to factory callables. YAML configs like `platform: {verifier: nvidia}` now drive component selection at runtime. - registry.py: PlatformRegistry with register/create/create_from_config and _filter_kwargs for signature-safe factory construction. Built-in nvidia implementations registered at import time. - opt_manager.py: @config_injectable decorator, new `platform` param, _resolve_platform() replaces three _default_* factory methods. Worker-level config (string names) propagated via worker_kwargs. - opt_worker.py: new `platform_config` param and _resolve_platform_config() to resolve worker-level components from the registry in each worker process. - examples/configs/: beam_search.yaml, greedy.yaml, nvidia.yaml - run_opt_manager.py: --config CLI option for config-driven construction * Add no-op platform implementations for dry-run testing (#113) * Add no-op platform implementations for dry-run testing No-op implementations pass the input kernel through unchanged, useful for CI environments without GPU hardware and integration tests. - noop.py: NoOpVerifier (returns True), NoOpBenchmarker (returns 1.0ms placeholder), NoOpWorkerRunner (returns parent kernel as success), plus worker-level stubs (NoOpSpecsProvider, NoOpProfiler, NoOpRooflineAnalyzer, NoOpBottleneckAnalyzer, NoOpRAGPrescriber). - registry.py: register all noop implementations under "noop" name. - __init__.py: re-export noop classes. - examples/configs/noop.yaml: greedy strategy with platform: noop. * Fix missing worker kwargs in config-driven construction - Add gpu_name and other worker kwargs to the --config path in run_opt_manager.py (were always passed in hardcoded paths). - Fix openai_model inconsistency across YAML configs. - Pass profiling_semaphore to fallback KernelProfiler construction so NCU profiling is properly serialized. * Fix config_injectable VAR_KEYWORD double-nesting bug When a decorated function has **kwargs, apply_defaults() stores them as {param_name: {}} in bound_args.arguments. Calling func(**result) then passes that as a keyword arg, nesting it inside the real **kwargs. Expand VAR_KEYWORD entries before returning so they stay flat. * forward fix bugs
Jack-Khuu
added a commit
that referenced
this pull request
Mar 3, 2026
* Add outer platform interfaces and extract NVIDIA impls from opt_manager Introduce KernelVerifier, KernelBenchmarker, and WorkerRunner abstract interfaces that define the seams where platform-specific code enters OptimizationManager. Extract the existing NVIDIA-specific code (verification via VerificationWorker, benchmarking via Benchmark, worker spawning via mp.Process) into NvidiaVerifier, NvidiaBenchmarker, and NvidiaWorkerRunner classes that implement these interfaces. OptimizationManager now delegates to self.verifier, self.benchmarker, and self.worker_runner instead of inlining the NVIDIA code. No behavioral changes — the same NVIDIA defaults are always constructed. * Add inner-worker platform interfaces and NVIDIA implementations Add 5 worker-level abstract interfaces for components inside OptimizationWorker: AcceleratorSpecsProvider, KernelProfilerBase, RooflineAnalyzerBase, BottleneckAnalyzerBase, RAGPrescriberBase. Add NVIDIA wrapper implementations that lazily delegate to the existing concrete classes (KernelProfiler, RooflineAnalyzer, BottleneckAnalyzer, RAGPrescriber, get_gpu_specs). Add platform_components dict parameter to OptimizationWorker so registry-resolved components can be injected from the manager level. _init_components() checks platform_components before falling back to the default NVIDIA construction. * Add platform component registry for config-driven selection (#112) Add no-op platform implementations for dry-run testing (#113) * Add platform component registry for config-driven selection Introduce PlatformRegistry that maps (component_key, impl_name) pairs to factory callables. YAML configs like `platform: {verifier: nvidia}` now drive component selection at runtime. - registry.py: PlatformRegistry with register/create/create_from_config and _filter_kwargs for signature-safe factory construction. Built-in nvidia implementations registered at import time. - opt_manager.py: @config_injectable decorator, new `platform` param, _resolve_platform() replaces three _default_* factory methods. Worker-level config (string names) propagated via worker_kwargs. - opt_worker.py: new `platform_config` param and _resolve_platform_config() to resolve worker-level components from the registry in each worker process. - examples/configs/: beam_search.yaml, greedy.yaml, nvidia.yaml - run_opt_manager.py: --config CLI option for config-driven construction * Add no-op platform implementations for dry-run testing (#113) * Add no-op platform implementations for dry-run testing No-op implementations pass the input kernel through unchanged, useful for CI environments without GPU hardware and integration tests. - noop.py: NoOpVerifier (returns True), NoOpBenchmarker (returns 1.0ms placeholder), NoOpWorkerRunner (returns parent kernel as success), plus worker-level stubs (NoOpSpecsProvider, NoOpProfiler, NoOpRooflineAnalyzer, NoOpBottleneckAnalyzer, NoOpRAGPrescriber). - registry.py: register all noop implementations under "noop" name. - __init__.py: re-export noop classes. - examples/configs/noop.yaml: greedy strategy with platform: noop. * Fix missing worker kwargs in config-driven construction - Add gpu_name and other worker kwargs to the --config path in run_opt_manager.py (were always passed in hardcoded paths). - Fix openai_model inconsistency across YAML configs. - Pass profiling_semaphore to fallback KernelProfiler construction so NCU profiling is properly serialized. * Fix config_injectable VAR_KEYWORD double-nesting bug When a decorated function has **kwargs, apply_defaults() stores them as {param_name: {}} in bound_args.arguments. Calling func(**result) then passes that as a keyword arg, nesting it inside the real **kwargs. Expand VAR_KEYWORD entries before returning so they stay flat. * forward fix bugs * lint
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.
No-op implementations pass the input kernel through unchanged, useful for reference, CI environments without GPU hardware, and integration tests.
noop.py: NoOpVerifier (returns True), NoOpBenchmarker (returns 1.0ms placeholder), NoOpWorkerRunner (returns parent kernel as success), plus worker-level stubs (NoOpSpecsProvider, NoOpProfiler, NoOpRooflineAnalyzer, NoOpBottleneckAnalyzer, NoOpRAGPrescriber).registry.py: register all noop implementations under "noop" name.examples/configs/noop.yaml: greedy strategy with platform: noop.