Skip to content

Conversation

bobrenjc93
Copy link
Contributor

@bobrenjc93 bobrenjc93 commented Jan 2, 2025

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jan 2, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/144091

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 3 Pending

As of commit 68d7766 with merge base d88a8c4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
level_indices: Tensor

def __init__(self, observer=APoTObserver, **observer_kwargs):
def __init__(self, observer: Callable = APoTObserver, **observer_kwargs: Any):
Copy link
Contributor

Choose a reason for hiding this comment

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

_P = ParamSpec("_P")
_R = TypeVar("_R")
...

class APoTFakeQuantize(FakeQuantizeBase):
    def __init__(self, observer: Callable[_P, _R] = APoTObserver, *observer_args: _P.args, **observer_kwargs: _P.kwargs):

Copy link
Contributor

Choose a reason for hiding this comment

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

(Although that may cascade into a bunch of other type errors...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah exactly:

>>> Lint for torch/ao/quantization/experimental/fake_quantize.py:

  Error (MYPY) [assignment]
    Incompatible default for argument "observer" (default has type
    "type[APoTObserver]", argument has type "Callable[_P, _R]")

        20  |    level_indices: Tensor
        21  |
        22  |    def __init__(
    >>> 23  |        self, observer: Callable[_P, _R] = APoTObserver, **observer_kwargs: Any
        24  |    ):
        25  |        super().__init__()
        26  |        self.activation_post_process = observer(**observer_kwargs)

  Error (MYPY) [call-arg]
    Too few arguments

        23  |        self, observer: Callable[_P, _R] = APoTObserver, **observer_kwargs: Any
        24  |    ):
        25  |        super().__init__()
    >>> 26  |        self.activation_post_process = observer(**observer_kwargs)
        27  |        self.dtype = self.activation_post_process.dtype
        28  |
        29  |    def calculate_qparams(self, signed: bool = False) -> tuple[Tensor, Tensor, Tensor, Tensor]:  # type: ignore[override]

  Error (MYPY) [attr-defined]
    "_R" has no attribute "dtype"

        24  |    ):
        25  |        super().__init__()
        26  |        self.activation_post_process = observer(**observer_kwargs)
    >>> 27  |        self.dtype = self.activation_post_process.dtype
        28  |
        29  |    def calculate_qparams(self, signed: bool = False) -> tuple[Tensor, Tensor, Tensor, Tensor]:  # type: ignore[override]
        30  |        return self.activation_post_process.calculate_qparams(signed=signed)

  Error (MYPY) [attr-defined]
    "_R" has no attribute "calculate_qparams"

        27  |        self.dtype = self.activation_post_process.dtype
        28  |
        29  |    def calculate_qparams(self, signed: bool = False) -> tuple[Tensor, Tensor, Tensor, Tensor]:  # type: ignore[override]
    >>> 30  |        return self.activation_post_process.calculate_qparams(signed=signed)
        31  |
        32  |    def forward(self, X: torch.Tensor) -> Tensor:  # type: ignore[override]
        33  |        if self.observer_enabled[0] == 1:

  Error (MYPY) [attr-defined]
    "_R" has no attribute "forward"

        31  |
        32  |    def forward(self, X: torch.Tensor) -> Tensor:  # type: ignore[override]
        33  |        if self.observer_enabled[0] == 1:
    >>> 34  |            self.activation_post_process.forward(X)
        35  |            result = self.activation_post_process.calculate_qparams(signed=False)
        36  |            self.alpha = result[0]
        37  |            self.gamma = result[1]

  Error (MYPY) [attr-defined]
    "_R" has no attribute "calculate_qparams"

        32  |    def forward(self, X: torch.Tensor) -> Tensor:  # type: ignore[override]
        33  |        if self.observer_enabled[0] == 1:
        34  |            self.activation_post_process.forward(X)
    >>> 35  |            result = self.activation_post_process.calculate_qparams(signed=False)
        36  |            self.alpha = result[0]
        37  |            self.gamma = result[1]
        38  |            self.quantization_levels = result[2]

[ghstack-poisoned]
[ghstack-poisoned]
@bobrenjc93 bobrenjc93 requested a review from aorenste January 2, 2025 19:35
@bobrenjc93
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 2, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@cyyever
Copy link
Collaborator

cyyever commented Jan 3, 2025

@pytorchmergebot merge -f "Unrelated pending"

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions github-actions bot deleted the gh/bobrenjc93/211/head branch February 2, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: AO frontend release notes: quantization release notes category topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants