Skip to content

BeamSearchStrategy: silent worker starvation when num_expanding_parents=0 #145

Description

@jayden1711

🐛 Describe the bug

num_expanding_parents accepts 0 and negative values without validation.
A value of 0 causes select_candidates() to return an empty candidate list,
spawning zero workers per round. All max_rounds rounds complete silently
with no optimization progress and no error or warning surfaced.

location: triton_kernel_agent/opt_worker_component/searching/strategy/beam_search.py

reproduction:

from triton_kernel_agent.opt_worker_component.searching import BeamSearchStrategy
s = BeamSearchStrategy(num_expanding_parents=0)
s.initialize(program)
candidates = s.select_candidates(round_num=1)
# candidates is empty and zero workers spawn, rounds consumed silently

two related problems I found:

  • BeamSearchStrategy candidate dicts are missing the inspirations key
    required by the SearchStrategy Protocol. GreedyStrategy already
    provides this key; the inconsistency means future Mutator implementations
    reading inspirations from the candidate dict would silently get nothing
    under beam search.
  • ptx_hash_from_cache silently skips unreadable PTX files with no log
    output, returning an incomplete fingerprint with no indication to the caller.

Have a fix ready for all three with 19 new tests in PR #146. All 72 existing tests
pass

Platform and Version

main branch, tested on Google Colab (NVIDIA T4 GPU), Python 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions