Skip to content

Python 3.9 does not support int.is_integer() #163

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

Closed
sjmonson opened this issue May 15, 2025 · 0 comments · Fixed by #164
Closed

Python 3.9 does not support int.is_integer() #163

sjmonson opened this issue May 15, 2025 · 0 comments · Fixed by #164
Assignees
Labels
bug Something isn't working

Comments

@sjmonson
Copy link
Collaborator

Versions of python older than 3.12 do not support int.is_integer() which can happen when --rate is called with a whole number:

Traceback (most recent call last):
  File "/opt/app-root/bin/guidellm", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/src/guidellm/src/guidellm/__main__.py", line 255, in benchmark
    asyncio.run(
  File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/app-root/src/guidellm/src/guidellm/benchmark/entrypoints.py", line 88, in benchmark_generative_text
    profile = create_profile(rate_type=rate_type, rate=rate)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/src/guidellm/src/guidellm/benchmark/profile.py", line 380, in create_profile
    return ConcurrentProfile.from_standard_args(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/src/guidellm/src/guidellm/benchmark/profile.py", line 138, in from_standard_args
    if not all(stream.is_integer() and stream > 0 for stream in rate):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/src/guidellm/src/guidellm/benchmark/profile.py", line 138, in <genexpr>
    if not all(stream.is_integer() and stream > 0 for stream in rate):
               ^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'is_integer'
@sjmonson sjmonson self-assigned this May 15, 2025
@sjmonson sjmonson added the bug Something isn't working label May 15, 2025
markurtz added a commit that referenced this issue May 15, 2025
We already support casting floats to int so to simplify the arg code and
solve an issue with older pythons just treat all input as floats.

Fixes #163

---------

Co-authored-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant