Skip to content

Conversation

@AditiThirdEye
Copy link

Add early validation of the --saveEngine output path to fail fast when the path is invalid or unwritable, avoiding wasted computation.

This change adds a canWriteFile() utility function that:

  • Checks if the parent directory exists
  • Tests write permissions by creating a temporary file
  • Cleans up the temporary file after testing

The validation runs immediately when --saveEngine is parsed, before any expensive ONNX parsing or engine building operations.

Add early validation of the --saveEngine output path to fail fast
when the path is invalid or unwritable, avoiding wasted computation.

This change adds a canWriteFile() utility function that:
- Checks if the parent directory exists
- Tests write permissions by creating a temporary file
- Cleans up the temporary file after testing

The validation runs immediately when --saveEngine is parsed, before
any expensive ONNX parsing or engine building operations.

Signed-off-by: Aditi_Pandey <54734131+AditiThirdEye@users.noreply.github.com>
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.

1 participant