Skip to content

[autotune] Decouple PrecompileFuture from BaseSearch via PrecompileContext#1925

Open
hinriksnaer wants to merge 3 commits intopytorch:mainfrom
hinriksnaer:precompile-context
Open

[autotune] Decouple PrecompileFuture from BaseSearch via PrecompileContext#1925
hinriksnaer wants to merge 3 commits intopytorch:mainfrom
hinriksnaer:precompile-context

Conversation

@hinriksnaer
Copy link
Copy Markdown
Collaborator

Groundwork for #1803

Replace the back-reference to the full BaseSearch object with a narrow 5-field PrecompileContext dataclass (settings, log, kernel, args, jobs). This makes PrecompileFuture's dependencies explicit and testable in isolation.

This change is part of a larger effort to introduce a BenchmarkProvider abstraction that encapsulates the benchmarking pipeline. PrecompileFuture currently holds a reference to BaseSearch to access 5 fields — when the BenchmarkProvider owns precompilation, it needs to pass its own context into PrecompileFuture without involving the search object. PrecompileContext makes that possible.

Replace the back-reference to the full BaseSearch object with a narrow
5-field PrecompileContext dataclass (settings, log, kernel, args, jobs).
This makes PrecompileFuture's dependencies explicit and testable in
isolation.

This change is part of a larger effort to introduce a BenchmarkProvider
abstraction that encapsulates the benchmarking pipeline. PrecompileFuture
currently holds a reference to BaseSearch to access 5 fields — when the
BenchmarkProvider owns precompilation, it needs to pass its own context
into PrecompileFuture without involving the search object. PrecompileContext
makes that possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants