Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Python 3.11 #131

Closed
vchuravy opened this issue May 21, 2023 · 2 comments
Closed

Issue with Python 3.11 #131

vchuravy opened this issue May 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vchuravy
Copy link

vchuravy commented May 21, 2023

After make install/local:

/opt/apps/omniperf/bin/omniperf 
Traceback (most recent call last):
  File "/opt/apps/omniperf/bin/omniperf", line 44, in <module>
    from omniperf_analyze.omniperf_analyze import roofline_only  # Standalone roofline
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/apps/omniperf/bin/omniperf_analyze/omniperf_analyze.py", line 45, in <module>
    from omniperf_analyze.utils import parser, file_io
  File "/opt/apps/omniperf/bin/omniperf_analyze/utils/parser.py", line 33, in <module>
    from omniperf_analyze.utils import schema
  File "/opt/apps/omniperf/bin/omniperf_analyze/utils/schema.py", line 56, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/lib/python3.11/dataclasses.py", line 1223, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/usr/lib/python3.11/dataclasses.py", line 1213, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'pandas.core.frame.DataFrame'> for field sys_info is not allowed: use default_factory

On f8fe039

@coleramos425
Copy link
Collaborator

I was able to reproduce this issue.

This is probably due to one of the following changes in the dataclasses standard library in version 3.11:

  • Changed in version 3.11: Instead of looking for and disallowing objects of type list, dict, or set, unhashable objects are now not allowed as default values. Unhashability is used to approximate mutability.

Lines 58-60 will likely need a __hash__ method
https://github.com/AMDResearch/omniperf/blob/f8fe039aa57422bb5036d647699f1f97298bed5d/src/omniperf_analyze/utils/schema.py#L56-L66

@coleramos425 coleramos425 self-assigned this May 30, 2023
@coleramos425 coleramos425 added the bug Something isn't working label May 30, 2023
coleramos425 added a commit that referenced this issue May 30, 2023
…hon 3.11 (#131)

Signed-off-by: coleramos425 <colramos@amd.com>
@coleramos425
Copy link
Collaborator

Instead I'm changing default values for sys_info, soc_spec, and raw_pmc attributes to None in Workload class

Tested this on Ubuntu 20.04, Python 3.11.3 and it fixed the issue. @vchuravy this change will be included in the next release

feizheng10 pushed a commit to feizheng10/omniperf that referenced this issue Dec 6, 2023
…hon 3.11 (ROCm#131)

Signed-off-by: coleramos425 <colramos@amd.com>
Signed-off-by: fei.zheng <fei.zheng@amd.com>
feizheng10 pushed a commit to feizheng10/omniperf that referenced this issue Dec 20, 2023
…hon 3.11 (ROCm#131)

Signed-off-by: coleramos425 <colramos@amd.com>
Signed-off-by: fei.zheng <fei.zheng@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants