Bug#1009200: pytorch: (autopkgtest) needs update for python3.10: 'float' object cannot be interpreted as an integer

2022-08-27 Thread M. Zhou
On Sat, 2022-08-27 at 08:55 +0200, Emanuele Rocca wrote:
> On 08/04 09:36, Paul Gevers wrote:
> > We are in the transition of making python3.10 the default Python
> > versions
> > [0]. With a recent upload of python3-defaults the autopkgtest of
> > pytorch
> > fails in testing when that autopkgtest is run with the binary
> > packages of
> > python3-defaults from unstable. It passes when run with only
> > packages from
> > testing.

FYI,
everything is already fixed in git a couple of months ago,
and we are just waiting for the package to go through NEW queue.



Bug#1009200: pytorch: (autopkgtest) needs update for python3.10: 'float' object cannot be interpreted as an integer

2022-08-27 Thread Emanuele Rocca
Hi,

On 08/04 09:36, Paul Gevers wrote:
> We are in the transition of making python3.10 the default Python versions
> [0]. With a recent upload of python3-defaults the autopkgtest of pytorch
> fails in testing when that autopkgtest is run with the binary packages of
> python3-defaults from unstable. It passes when run with only packages from
> testing.

There's an upstream issue tracking the ongoing work to add Python 3.10
support to pytorch:
https://github.com/pytorch/pytorch/issues/66424

The following pull request linked in the issue in particular seems
relevant for this bug:
https://github.com/pytorch/pytorch/pull/74007

This one may be needed too:
https://github.com/pytorch/pytorch/pull/74013



Bug#1009200: pytorch: (autopkgtest) needs update for python3.10: 'float' object cannot be interpreted as an integer

2022-04-08 Thread Paul Gevers

Source: pytorch
Version: 1.8.1-5
Severity: serious
Tags: sid bookworm
User: debian...@lists.debian.org
Usertags: needs-update
User: debian-pyt...@lists.debian.org
Usertags: python3.10
Control: affects -1 src:python3-defaults

Dear maintainer(s),

We are in the transition of making python3.10 the default Python 
versions [0]. With a recent upload of python3-defaults the autopkgtest 
of pytorch fails in testing when that autopkgtest is run with the binary 
packages of python3-defaults from unstable. It passes when run with only 
packages from testing. In tabular form:


   passfail
python3-defaults   from testing3.10.4-1
pytorchfrom testing1.8.1-5
all others from testingfrom testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of python3-defaults 
to testing [1]. https://docs.python.org/3/whatsnew/3.10.html lists 
what's new in Python3.10, it may help to identify what needs to be updated.


More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[0] https://bugs.debian.org/1006836
[1] https://qa.debian.org/excuses.php?package=python3-defaults

https://ci.debian.net/data/autopkgtest/testing/amd64/p/pytorch/20675875/log.gz


=== FAILURES 
===
 TestDistributions.test_invalid_parameter_broadcasting 
_


self = testMethod=test_invalid_parameter_broadcasting>


def test_invalid_parameter_broadcasting(self):
# invalid broadcasting cases; should throw error
# example type (distribution class, distribution params)
invalid_examples = [
(Normal, {
'loc': torch.tensor([[0, 0]]),
'scale': torch.tensor([1, 1, 1, 1])
}),
(Normal, {
'loc': torch.tensor([[[0, 0, 0], [0, 0, 0]]]),
'scale': torch.tensor([1, 1])
}),
(FisherSnedecor, {
'df1': torch.tensor([1, 1]),
'df2': torch.tensor([1, 1, 1]),
}),
(Gumbel, {
'loc': torch.tensor([[0, 0]]),
'scale': torch.tensor([1, 1, 1, 1])
}),
(Gumbel, {
'loc': torch.tensor([[[0, 0, 0], [0, 0, 0]]]),
'scale': torch.tensor([1, 1])
}),
(Gamma, {
'concentration': torch.tensor([0, 0]),
'rate': torch.tensor([1, 1, 1])
}),
(Kumaraswamy, {
'concentration1': torch.tensor([[1, 1]]),
'concentration0': torch.tensor([1, 1, 1, 1])
}),
(Kumaraswamy, {
'concentration1': torch.tensor([[[1, 1, 1], [1, 1, 1]]]),
'concentration0': torch.tensor([1, 1])
}),
(Laplace, {
'loc': torch.tensor([0, 0]),
'scale': torch.tensor([1, 1, 1])
}),
(Pareto, {
'scale': torch.tensor([1, 1]),
'alpha': torch.tensor([1, 1, 1])
}),
(StudentT, {
'df': torch.tensor([1, 1]),
'scale': torch.tensor([1, 1, 1])
}),
(StudentT, {
'df': torch.tensor([1, 1]),
'loc': torch.tensor([1, 1, 1])
})
]
for dist, kwargs in invalid_examples:

  self.assertRaises(RuntimeError, dist, **kwargs)


distributions/test_distributions.py:2871: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/torch/distributions/studentT.py:45: in 
__init__

self.df, self.loc, self.scale = broadcast_all(df, loc, scale)
/usr/lib/python3/dist-packages/torch/distributions/utils.py:37: in 
broadcast_all
new_values = [v if isinstance(v, torch.Tensor) or 
has_torch_function((v,)) else torch.tensor(v, **options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _

  new_values = [v if isinstance(v, torch.Tensor) or has_torch_function((v,)) 
else torch.tensor(v, **options)

  for v in values]
E   TypeError: 'float' object cannot be interpreted as an integer

/usr/lib/python3/dist-packages/torch/distributions/utils.py:37: TypeError
=== warnings summary 
===

../../../../../../usr/lib/python3/dist-packages/torch/testing/_internal/common_cuda.py:9

/usr/lib/python3/dist-packages/torch/testing/_internal/common_cuda.py:9: 
DeprecationWarning: The distutils package is deprecated and slated for 
removal in Python 3.12. Use setuptools or check PEP 632 for potential 
alternatives

from distutils.version import LooseVersion

test/distributions/test_distributions.py::TestJit::test_cdf