Skip to content

Adds skills and various code improvements#832

Merged
pranavm-nvidia merged 11 commits intomainfrom
skills
Mar 24, 2026
Merged

Adds skills and various code improvements#832
pranavm-nvidia merged 11 commits intomainfrom
skills

Conversation

@pranavm-nvidia
Copy link
Collaborator

No description provided.

- Store os.open() result and close it after os.dup2()
- Close NamedTemporaryFile in finally block
- Move tempfile creation before try so cleanup always runs
Use utils.default() instead of mutable list default parameter.
- Remove loop that built stack_modules/stack_classes only to be overwritten
- Remove unused stack_classes variable
- Simplify recursion guard to only check stack_modules
Replace hardcoded if/if blocks with a _DTYPE_SUGGESTIONS dict lookup.
- trace/ops/base.py: infer_dtypes() now uses raise_error() instead of assert
- frontend/tensor.py: Tensor.__init__ data!=None check uses raise_error()

These checks are no longer stripped by python -O.
Use super().__getattribute__ for guard checks to avoid recursion.
Errors are no longer stripped by python -O.
Ensures KeyboardInterrupt and SystemExit still propagate.
Fixed in utils/ast.py, utils/utils.py, and common/exception.py.
- compiler.py: Wrap _get_compiler_objects() with threading.Lock
- base.py: Replace manual _COUNT with itertools.count() (atomic in CPython)
- Add concurrent test for compiler client initialization
Use threading.Lock to ensure the wrapped function runs exactly once
even under concurrent access. Added tests for both serial and
concurrent invocation.
@pranavm-nvidia pranavm-nvidia merged commit 67c72ad into main Mar 24, 2026
5 checks passed
@pranavm-nvidia pranavm-nvidia deleted the skills branch March 24, 2026 22:48
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