Skip to content

Conversation

@gs-olive
Copy link
Contributor

@gs-olive gs-olive commented Dec 8, 2022

Description

  • Add support for specifying one, both, or neither integer bound (in Python) on Tensor domain used for generating a sample tensor in shape analysis
  • Add bounds checking to avoid int32_t overflow issues
  • Add validation for inputs to ensure high bound exceeds low bound and inputs are strictly integers
  • Use [0, 2) as the default bound, which works well as a random-number selection range in cases of Bool, Int, and Float types
  • Add validation in C++ to ensure provided domain arguments have the correct number of elements and ordering
  • Add functionality to print domains as part of both partitioning and initialization, for debugging purposes
  • Add hooks in pybind to capture specified input domain argument and parse values for mirrored internal representation
  • Add new Input constructors with defaults to accommodate new tensor_domain argument

Fixes #1531
Addresses Prototype + MVP of #1425

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
    • Manually tested Python API on sample scripts, including invalid input domains
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

@gs-olive gs-olive requested a review from narendasan December 8, 2022 02:33
@gs-olive gs-olive self-assigned this Dec 8, 2022
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: api [C++] Issues re: C++ API component: core Issues re: The core compiler component: partitioning labels Dec 8, 2022
@github-actions github-actions bot requested review from bowang007 and peri044 December 8, 2022 02:33
@github-actions github-actions bot added the component: tests Issues re: Tests label Dec 8, 2022
- Add support for specifying one, both, or neither integer bound (in
Python) on Tensor domain used for generating a sample tensor in shape analysis
- Add bounds checking to avoid int32_t overflow issues
- Add validation for inputs to ensure high bound exceeds low bound and
inputs are strictly integers
- Use [0, 2) as the default bound, which works well as a random-number
selection range in cases of Bool, Int, and Float types
- Add validation in C++ to ensure provided domain arguments have the
correct number of elements and ordering
- Add functionality to print domains as part of both partitioning and
initialization, for debugging purposes
- Add hooks in pybind to capture specified input domain argument and
parse values for mirrored internal representation
- Add new Input constructors with defaults to accommodate new `tensor_domain` argument
- Add pybind and torchbind get/set fields for C++ and Python API
compatibility
- Add C++ and Python collections test cases to ensure domain
specification is functional across APIs
@gs-olive gs-olive force-pushed the dynamic_input_domain_phase_1 branch from 7e91ee0 to 7be7982 Compare December 8, 2022 18:16
@narendasan
Copy link
Collaborator

narendasan commented Dec 13, 2022

@bowang007 can you be the reviewer for this PR?

Copy link
Collaborator

@bowang007 bowang007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Update Python API to accept a full domain definition or None, without
intermediates
- Update cpp and Python APIs to include float support
- Update data structure for tensor domain object to _Float64
- Add tests to ensure tensor domain usage in shape analysis is covered
via test cases
@gs-olive gs-olive force-pushed the dynamic_input_domain_phase_1 branch from 5d29a19 to ce84566 Compare February 9, 2023 18:13
@gs-olive gs-olive merged commit 3d59933 into pytorch:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [C++] Issues re: C++ API component: api [Python] Issues re: Python API component: core Issues re: The core compiler component: partitioning component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨[Feature] Allow specification of integer range for Input class

4 participants