Skip to content

Validate --cache-location and --log-location options early with actionable warnings#35

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/option-validation-in-omniprobe
Draft

Validate --cache-location and --log-location options early with actionable warnings#35
Copilot wants to merge 2 commits intomainfrom
copilot/option-validation-in-omniprobe

Conversation

Copy link

Copilot AI commented Mar 16, 2026

Two silent failure modes: a typo in --cache-location (e.g. /.triton/cache vs ~/.triton/cache) caused instrumentation to run against a wrong/empty directory with no feedback; a missing parent directory for -l /path/to/output.json caused output to be silently dropped.

Changes

  • is_triton_cache_dir(path) — new helper that returns True only if the directory contains at least one subdirectory (Triton's per-kernel hash dirs). Empty directories fail the check.

  • --cache-location validation — when the path exists as a directory but passes no subdirectory check, emit:

    WARNING: Cache location /path exists but appears to be empty or not a Triton cache
    directory. Instrumented kernels may not be found there.
    
  • --log-location parent-dir validation — when the parent directory is missing, attempt os.makedirs() (mirroring existing --cache-location behavior); fall back to console with a clear error on OSError. Also fixes the misleading "either doesn't exist or it is a directory" warning — that branch is only reachable when the path is a directory.

Original prompt

This section details on the original issue you should resolve

<issue_title>Option validation in Omniprobe</issue_title>
<issue_description>One area for improvement (and reduces support requests) is error handling w.r.t. command line arguments, e.g.

  • User made a typo in the path to the Triton cache: /.triton/cache instead of ~/.triton/cache. Instrumentation was happening, but instrumented kernels were never found. We may want to check if the provided directory is indeed a Triton cache directory.
  • When writing output to file with -l /path/to/output.json, if the path does not exist, no output is written. We should either create the directory (if permissions allow), or catch and report the error early.</issue_description>

Comments on the Issue (you are @copilot in this section)

@rwvo May have been addressed already, but I'll ask copilot to check, and implement if it hasn't been.

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: rwvo <21990117+rwvo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix option validation for command line arguments in Omniprobe Validate --cache-location and --log-location options early with actionable warnings Mar 16, 2026
Copilot AI requested a review from rwvo March 16, 2026 20:21
Copilot finished work on behalf of rwvo March 16, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option validation in Omniprobe

2 participants