Skip to content

[REFACTOR][LINT] Modernize ruff config#18810

Merged
tqchen merged 1 commit into
apache:mainfrom
tqchen:ruff-lint-cleanup
Feb 23, 2026
Merged

[REFACTOR][LINT] Modernize ruff config#18810
tqchen merged 1 commit into
apache:mainfrom
tqchen:ruff-lint-cleanup

Conversation

@tqchen

@tqchen tqchen commented Feb 22, 2026

Copy link
Copy Markdown
Member

This PR removes the extra lint violations from the codebase so lint aligns with the latest style

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @tqchen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly modernizes the TVM codebase's linting infrastructure by updating the ruff configuration, fixing numerous linting violations, and removing legacy pylint directives. The changes promote cleaner, more modern Python syntax, particularly with type hints and string formatting, enhancing code readability and maintainability across a large number of files.

Highlights

  • Ruff Configuration Modernization: The ruff configuration has been updated to align with tvm-ffi standards, targeting Python 3.10 and setting a line length of 100. The selected linting rules have been expanded to include E, F, I, UP, RUF.
  • Lint Violation Fixes: Over 5000 linting violations have been fixed, including UP006/UP007/UP035/UP038/UP045, E101/E711-E721, and RUF002-RUF028. This involved adding from __future__ import annotations across the codebase for modern type syntax and converting typing.List, typing.Dict, typing.Union to native type hints.
  • Pylint Removal: All approximately 2250 # pylint: disable/enable comments have been removed, as ruff now handles linting. Specific ruff rules are now ignored per-file or per-use where intentional patterns exist.
  • Codebase-Wide Type Hinting and F-string Adoption: Many files now use from __future__ import annotations and have updated type hints from typing.List to list, typing.Dict to dict, and typing.Union to |. String formatting has been modernized to use f-strings where applicable.
  • Hexagon Build and RPC Improvements: Updates to Hexagon build scripts include changing subprocess.Popen and subprocess.check_call arguments to use *args unpacking for command lists, and replacing stdout=subprocess.PIPE, stderr=subprocess.PIPE with capture_output=True for cleaner subprocess handling.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/conf.py
    • Added future import for annotations.
    • Removed List import from typing.
    • Converted string formatting to f-strings.
    • Updated reset_modules tuple.
    • Changed type hint for distinguish_class_name function.
  • docs/deep_dive/relax/tutorials/relax_transformation.py
    • Removed pylint disable comment.
  • docs/download_3rdparty_embeds.py
    • Added future import for annotations.
    • Removed pylint disable comment.
    • Replaced typing imports with native type hints.
  • docs/how_to/tutorials/cross_compilation_and_rpc.py
    • Converted print statement to f-strings.
  • docs/how_to/tutorials/customize_opt.py
    • Removed pylint disable comment.
  • docs/how_to/tutorials/optimize_llm.py
    • Added future import for annotations.
    • Removed List import from typing.
    • Removed pylint disable comments.
    • Updated type hints from Optional to | None and List to list.
  • pyproject.toml
    • Updated ruff target-version to py310.
    • Reduced global ruff ignore list.
    • Added extensive per-file ruff ignore configurations for various directories.
  • python/tvm/init.py
    • Removed pylint disable comments.
  • python/tvm/arith/analyzer.py
    • Removed pylint disable comment.
    • Updated type hints from Union to |.
  • python/tvm/arith/pattern.py
    • Added future import for annotations.
    • Updated type hint from Dict to dict.
  • python/tvm/base.py
    • Removed pylint disable comments.
  • python/tvm/contrib/cc.py
    • Added future import for annotations.
    • Removed pylint disable comments and Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/clang.py
    • Removed pylint disable comment.
  • python/tvm/contrib/cudnn.py
    • Removed pylint disable comment.
  • python/tvm/contrib/cutlass/attention_operation.py
    • Removed pylint disable comment.
    • Fixed C++ template string indentation.
  • python/tvm/contrib/cutlass/build.py
    • Added future import for annotations.
    • Removed pylint disable comments and updated Sequence import.
    • Updated type hints from Optional to | None.
    • Converted string formatting to f-strings.
    • Updated type hint from tuple to |.
  • python/tvm/contrib/cutlass/conv2d_operation.py
    • Removed pylint disable comments.
    • Converted string formatting to f-strings.
  • python/tvm/contrib/cutlass/conv2d_profiler.py
    • Removed pylint disable comments.
    • Fixed C++ template string indentation.
  • python/tvm/contrib/cutlass/gemm_operation.py
    • Removed pylint disable comments.
    • Converted string formatting to f-strings.
  • python/tvm/contrib/cutlass/gemm_profiler.py
    • Removed pylint disable comments.
  • python/tvm/contrib/cutlass/gen_conv2d.py
    • Removed pylint disable comments.
    • Converted string formatting to f-strings.
  • python/tvm/contrib/cutlass/gen_gemm.py
    • Removed pylint disable comment.
  • python/tvm/contrib/cutlass/gen_tensor_op.py
    • Removed pylint disable comments.
  • python/tvm/contrib/cutlass/layer_norm_operation.py
    • Removed pylint disable comment.
  • python/tvm/contrib/cutlass/library.py
    • Removed pylint disable comments.
    • Updated type hints from tuple to |.
    • Converted string formatting to f-string.
  • python/tvm/contrib/cutlass/rms_norm_operation.py
    • Removed pylint disable comment.
  • python/tvm/contrib/dlpack.py
    • Removed pylint disable comment.
  • python/tvm/contrib/download.py
    • Removed pylint disable comments.
    • Updated type hint from tuple to |.
  • python/tvm/contrib/emcc.py
    • Removed pylint disable comment.
  • python/tvm/contrib/hexagon/build.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
    • Changed subprocess capture output method.
    • Updated subprocess command list construction.
    • Used itertools.pairwise for boundary iteration.
  • python/tvm/contrib/hexagon/generate_take_op.py
    • Removed pylint disable comments.
  • python/tvm/contrib/hexagon/hexagon_profiler.py
    • Removed pylint disable comment.
    • Updated subprocess command list construction.
  • python/tvm/contrib/hexagon/hexagon_unary_ops.py
    • Removed pylint disable comments.
  • python/tvm/contrib/hexagon/meta_schedule.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/hexagon/pytest_plugin.py
    • Removed pylint disable comments.
    • Updated type hints from Optional to | None.
    • Updated type hints from Union to |.
  • python/tvm/contrib/hexagon/session.py
    • Removed pylint disable comment.
    • Updated type hints from Union to |.
  • python/tvm/contrib/hexagon/tools.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated HEXAGON_TOOLCHAIN variable assignments.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Used itertools.pairwise for boundary iteration.
  • python/tvm/contrib/miopen.py
    • Removed pylint disable comment.
  • python/tvm/contrib/mps.py
    • Removed pylint disable comment.
  • python/tvm/contrib/mrvl.py
    • Removed pylint disable comments.
  • python/tvm/contrib/msc/core/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Removed pylint disable comment.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/core/codegen/sources.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/core/frontend/translate.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/gym/agent/base_agent.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/gym/agent/method.py
    • Removed pylint disable comment.
  • python/tvm/contrib/msc/core/gym/agent/search_agent.py
    • Added future import for annotations.
    • Removed List import from typing.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/core/gym/control/controller.py
    • Added future import for annotations.
    • Removed Dict import from typing.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/core/gym/control/service.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/core/gym/environment/base_env.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/core/gym/environment/method.py
    • Added future import for annotations.
    • Removed pylint disable comment and List import.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/core/gym/environment/prune_env.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/core/gym/environment/quantize_env.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/ir/graph.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Replaced explicit loop for yielding weights/tensors with yield from.
  • python/tvm/contrib/msc/core/runtime/hook.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/runtime/jit.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/runtime/runner.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/tools/configer.py
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/tools/distill/distiller.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/core/tools/distill/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/core/tools/execute.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/core/tools/prune/configer.py
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/tools/prune/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/core/tools/prune/pruner.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/tools/quantize/configer.py
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/tools/quantize/method.py
    • Removed pylint disable comment.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/core/tools/quantize/quantizer.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/core/tools/tool.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Replaced explicit loop for yielding nodes/tensors with yield from.
  • python/tvm/contrib/msc/core/tools/track/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/core/tools/track/tracker.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/core/transform/pattern.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/transform/transform.py
    • Added future import for annotations.
    • Removed pylint disable comments and Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/core/utils/arguments.py
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/utils/dataset.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/utils/expr.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/core/utils/file.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/core/utils/info.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/core/utils/log.py
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/core/utils/message.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/core/utils/namespace.py
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/core/utils/register.py
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/framework/tensorflow/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/msc/framework/tensorflow/frontend/translate.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/framework/tensorflow/runtime/runner.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tensorrt/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/framework/tensorrt/codegen/sources.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/framework/tensorrt/frontend/translate.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tensorrt/runtime/runner.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/framework/tensorrt/tools/quantize/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/framework/tensorrt/tools/quantize/quantizer.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tensorrt/tools/track/tracker.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/framework/tensorrt/transform/pattern.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tensorrt/transform/transform.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/framework/torch/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/framework/torch/frontend/translate.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/contrib/msc/framework/torch/runtime/jit.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/torch/runtime/runner.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/torch/tools/distill/distiller.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/framework/torch/tools/distill/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/framework/torch/tools/quantize/method.py
    • Removed pylint disable comments.
  • python/tvm/contrib/msc/framework/tvm/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
  • python/tvm/contrib/msc/framework/tvm/runtime/runner.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tvm/tools/quantize/method.py
    • Added future import for annotations.
    • Removed pylint disable comments and Tuple import.
    • Updated type hint from Tuple to tuple.
  • python/tvm/contrib/msc/framework/tvm/tools/quantize/quantizer.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/framework/tvm/tools/track/tracker.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/pipeline/dynamic.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/pipeline/manager.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/pipeline/pipeline.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/pipeline/utils.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/contrib/msc/pipeline/worker.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Optional to | None.
  • python/tvm/contrib/msc/plugin/build.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/plugin/codegen/codegen.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/contrib/msc/plugin/codegen/sources.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/plugin/register.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/msc/plugin/utils.py
    • Updated type hints from Union to |.
  • python/tvm/contrib/ndk.py
    • Added future import for annotations.
    • Removed pylint disable comments and Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/contrib/nvcc.py
    • Added future import for annotations.
    • Removed pylint disable comments and Tuple import.
    • Updated type hints from Union to |.
  • python/tvm/contrib/pickle_memoize.py
    • Removed pylint disable comments.
    • Updated tuple concatenation to use unpacking.
  • python/tvm/contrib/popen_pool.py
    • Removed pylint disable comments.
  • python/tvm/contrib/rocm.py
    • Removed pylint disable comment.
  • python/tvm/contrib/rpc.py
    • Removed pylint disable comment.
  • python/tvm/contrib/tar.py
    • Removed pylint disable comment.
  • python/tvm/contrib/tvmjs.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Optional to | None.
    • Updated type hints from Mapping to collections.abc.Mapping.
    • Updated type hints from Iterator to collections.abc.Iterator.
    • Updated type hints from Set to set.
    • Updated type hints from Tuple to tuple.
    • Converted print statements to f-strings.
  • python/tvm/contrib/utils.py
    • Updated type hints from Union to |.
    • Updated list concatenation to use unpacking.
  • python/tvm/contrib/xcode.py
    • Removed pylint disable comments.
    • Updated list concatenation to use unpacking.
  • python/tvm/driver/init.py
    • Removed pylint disable comment.
  • python/tvm/driver/build_module.py
    • Removed pylint disable comment and specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Optional to | None.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/exec/disco_remote_socket_session.py
    • Removed pylint disable comments.
  • python/tvm/exec/disco_worker.py
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Callable to collections.abc.Callable.
    • Updated list concatenation to use unpacking.
  • python/tvm/exec/gpu_memory_bandwidth.py
    • Removed pylint disable comments.
  • python/tvm/exec/popen_worker.py
    • Removed pylint disable comments.
  • python/tvm/exec/query_rpc_tracker.py
    • Converted print statements to f-strings.
  • python/tvm/exec/rpc_proxy.py
    • Converted string formatting to f-strings.
  • python/tvm/exec/rpc_server.py
    • Removed pylint disable comments.
  • python/tvm/exec/rpc_tracker.py
    • Removed pylint disable comments.
  • python/tvm/ffi.py
    • Removed pylint disable comment.
  • python/tvm/ir/init.py
    • Removed pylint disable comment.
  • python/tvm/ir/analysis.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/ir/base.py
    • Removed pylint disable comments.
  • python/tvm/ir/diagnostics/init.py
    • Removed pylint disable comment.
  • python/tvm/ir/expr.py
    • Updated type hints from Optional to | None.
    • Updated type hints from Union to |.
  • python/tvm/ir/function.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
  • python/tvm/ir/global_info.py
    • Updated type hints from Union to |.
  • python/tvm/ir/instrument.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
  • python/tvm/ir/module.py
    • Updated type hints from Union to |.
  • python/tvm/ir/op.py
    • Removed pylint disable comments.
  • python/tvm/ir/supply.py
    • Updated type hints from Union to |.
  • python/tvm/ir/transform.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
  • python/tvm/ir/type.py
    • Removed pylint disable comment.
  • python/tvm/libinfo.py
    • Converted print statement to f-string.
  • python/tvm/relax/init.py
    • Removed pylint disable comments.
  • python/tvm/relax/analysis/analysis.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/relax/analysis/estimate_memory_usage.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
  • python/tvm/relax/backend/adreno/clml.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/adreno/pipeline.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/adreno/transform/transform.py
    • Removed pylint disable comment.
  • python/tvm/relax/backend/contrib/nnapi.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/backend/cpu_generic/pipeline.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/cuda/cublas.py
    • Updated type hints from Union to |.
  • python/tvm/relax/backend/cuda/cudnn.py
    • Updated type hints from Union to |.
  • python/tvm/relax/backend/cuda/cutlass.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
  • python/tvm/relax/backend/cuda/flashinfer.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Removed pylint disable comments.
  • python/tvm/relax/backend/cuda/pipeline.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/dispatch_sampling.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/dispatch_sort_scan.py
    • Added future import for annotations.
    • Removed pylint disable comments and Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/relax/backend/gpu_generic/cumsum.py
    • Removed pylint disable comment.
  • python/tvm/relax/backend/gpu_generic/pipeline.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/gpu_generic/sampling.py
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/backend/metal/coreml.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/pattern_registry.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Set to set.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Optional to | None.
  • python/tvm/relax/backend/patterns.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/backend/rocm/hipblas.py
    • Removed pylint disable comment.
  • python/tvm/relax/backend/rocm/pipeline.py
    • Removed pylint disable comments.
  • python/tvm/relax/backend/utils.py
    • Added future import for annotations.
    • Removed pylint disable comments and Tuple import.
    • Updated type hint from Tuple to tuple.
  • python/tvm/relax/base_py_module.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/binding_rewrite.py
    • Removed pylint disable comments.
  • python/tvm/relax/block_builder.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
    • Updated type hints from Sequence to collections.abc.Sequence.
  • python/tvm/relax/distributed/global_info.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Union to |.
  • python/tvm/relax/distributed/struct_info.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/relax/distributed/transform/transform.py
    • Removed pylint disable comment.
  • python/tvm/relax/dpl/context.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/relax/dpl/pattern.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/dpl/rewrite.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from Union to |.
  • python/tvm/relax/exec_builder.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/expr.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Union to |.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Dict to dict.
    • Updated type hints from Mapping to collections.abc.Mapping.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/expr_functor.py
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/common.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/frontend/nn/init.py
    • Removed pylint disable comment.
  • python/tvm/relax/frontend/nn/_tensor_op.py
    • Removed pylint disable comments.
  • python/tvm/relax/frontend/nn/core.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
    • Updated type hints from Iterator to collections.abc.Iterator.
    • Updated type hints from Sequence to collections.abc.Sequence.
  • python/tvm/relax/frontend/nn/exporter.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/frontend/nn/llm/kv_cache.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/frontend/nn/llm/position_embedding.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/nn/llm/tree_attn.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/frontend/nn/modules.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Updated type hints from Sequence to collections.abc.Sequence.
  • python/tvm/relax/frontend/nn/op.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Sequence to collections.abc.Sequence.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/nn/spec.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/frontend/nn/subroutine.py
    • Removed pylint disable comments.
  • python/tvm/relax/frontend/nn/torch.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
  • python/tvm/relax/frontend/onnx/onnx_frontend.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Removed pylint disable comments.
  • python/tvm/relax/frontend/stablehlo/stablehlo_translator.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/torch/base_fx_graph_translator.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/torch/dynamo.py
    • Removed pylint disable comments.
  • python/tvm/relax/frontend/torch/exported_program_translator.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/frontend/torch/fx_translator.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/op/init.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/_op_gradient.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/relax/op/base.py
    • Added future import for annotations.
    • Removed pylint disable comment and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/binary.py
    • Removed pylint disable comments.
  • python/tvm/relax/op/builtin/builtin.py
    • Updated type hints from Union to |.
  • python/tvm/relax/op/ccl/ccl.py
    • Removed pylint disable comments.
  • python/tvm/relax/op/create.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/datatype.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/distributed/distributed.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/grad/grad.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/op/image/image.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/index.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/linear_algebra.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/manipulate.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/op/memory/memory.py
    • Updated type hints from Union to |.
  • python/tvm/relax/op/memory/view.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Sequence to collections.abc.Sequence.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/nn/nn.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/qdq.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/search.py
    • Removed pylint disable comment.
  • python/tvm/relax/op/set.py
    • Removed pylint disable comments.
  • python/tvm/relax/op/statistical.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/op/ternary.py
    • Removed pylint disable comments.
  • python/tvm/relax/op/unary.py
    • Removed pylint disable comments.
  • python/tvm/relax/op/vm/vm.py
    • Updated type hints from Union to |.
  • python/tvm/relax/pipeline.py
    • Removed pylint disable comment.
  • python/tvm/relax/relax_to_pyfunc_converter.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/struct_info.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/testing/init.py
    • Removed pylint disable comments.
  • python/tvm/relax/testing/ast_printer.py
    • Added future import for annotations.
    • Removed pylint disable comments and Iterable import.
    • Updated type hints from Iterable to collections.abc.Iterable.
  • python/tvm/relax/testing/attention.py
    • Removed pylint disable comments.
  • python/tvm/relax/testing/lib_comparator.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Iterable to collections.abc.Iterable.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/testing/matmul.py
    • Updated list concatenation to use unpacking.
  • python/tvm/relax/testing/nn.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/testing/runtime_builtin.py
    • Removed pylint disable comment.
  • python/tvm/relax/testing/transform.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Set to set.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/testing/vm.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
  • python/tvm/relax/training/loss.py
    • Removed pylint disable comments and typing_extensions import.
    • Updated type hints from Union to |.
  • python/tvm/relax/training/optimizer.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/training/setup_trainer.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/training/trainer.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/relax/training/utils.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Callable to collections.abc.Callable.
  • python/tvm/relax/transform/attach_external_modules.py
    • Added future import for annotations.
    • Removed specific typing imports.
    • Updated type hints from List to list.
  • python/tvm/relax/transform/fast_math.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/fold_batch_norm_to_conv2d_for_inference.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/fuse_transpose_matmul.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/ipc_allreduce_rewrite.py
    • Added future import for annotations.
    • Removed Dict import.
    • Updated type hint from Dict to dict.
  • python/tvm/relax/transform/lazy_transform_params.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/legalize_ops/adreno/convolution.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/legalize_ops/binary.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/ccl.py
    • Removed pylint disable comment.
    • Updated list concatenation to use unpacking.
  • python/tvm/relax/transform/legalize_ops/common.py
    • Updated type hints from Union to |.
  • python/tvm/relax/transform/legalize_ops/create.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/datatype.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/distributed.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/grad.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/legalize_ops/image/image.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/index.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/inspect_op.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/linear_algebra.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/manipulate.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/memory/memory.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/memory/view.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/nn.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/legalize_ops/qdq.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/search.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/legalize_ops/statistical.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
  • python/tvm/relax/transform/legalize_ops/unary.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/lower_gpu_ipc_alloc_storage.py
    • Removed pylint disable comment.
  • python/tvm/relax/transform/optimize_layout_transform.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/remove_redundant_reshape.py
    • Removed pylint disable comments.
  • python/tvm/relax/transform/transform.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
    • Updated type hints from Union to |.
    • Updated type hints from Mapping to collections.abc.Mapping.
    • Updated type hints from Callable to collections.abc.Callable.
    • Updated type hints from Sequence to collections.abc.Sequence.
  • python/tvm/relax/ty.py
    • Removed pylint disable comments.
  • python/tvm/relax/type_converter.py
    • Added future import for annotations.
    • Removed pylint disable comments and List import.
  • python/tvm/relax/utils.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Tuple to tuple.
  • python/tvm/relax/vm_build.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Optional to | None.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
    • Updated type hints from Union to |.
  • python/tvm/rpc/base.py
    • Removed pylint disable comment.
  • python/tvm/rpc/client.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
    • Converted string formatting to f-strings.
  • python/tvm/rpc/proxy.py
    • Removed pylint disable comments.
  • python/tvm/rpc/server.py
    • Removed pylint disable comments.
  • python/tvm/rpc/server_ios_launcher.py
    • Added future import for annotations.
    • Removed pylint disable comments and specific typing imports.
    • Updated type hints from Dict to dict.
    • Updated type hints from List to list.
  • python/tvm/rpc/testing.py
    • Removed pylint disable comments.
  • python/tvm/rpc/tracker.py
    • Removed pylint disable comment.
  • python/tvm/runtime/_ffi_node_api.py
    • Removed pylint disable comments.
  • python/tvm/runtime/_tensor.py
    • Removed pylint disable comments.
    • Updated type hints from Union to |.
    • Updated tuple concatenation to use unpacking.
  • python/tvm/runtime/device.py
    • Removed pylint disable comments.
  • python/tvm/runtime/disco/process_pool.py
    • Removed pylint disable comments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request modernizes the TVM codebase by updating the Ruff configuration to target Python 3.10 and adopting modern type hint syntax (PEP 585 and PEP 604). The addition of from __future__ import annotations across the codebase is a significant improvement for maintainability. However, while the PR fixes many lint violations, it also introduces extensive directory-wide suppressions in pyproject.toml for critical rules like E722 (bare except). This review highlights opportunities to replace these bare excepts with safer alternatives and to remove redundant lambda functions in transformation passes.

Comment thread pyproject.toml Outdated
Comment thread python/tvm/contrib/msc/core/utils/arguments.py Outdated
Comment thread python/tvm/contrib/msc/core/utils/info.py Outdated
Comment thread python/tvm/relax/transform/fuse_transpose_matmul.py Outdated
Comment thread python/tvm/relax/transform/legalize_ops/linear_algebra.py Outdated
@tqchen tqchen changed the title [REFACTOR] Modernize ruff config, align with tvm-ffi, fix lint violations [REFACTOR][LINT] Modernize ruff config Feb 22, 2026
@tqchen tqchen force-pushed the ruff-lint-cleanup branch 10 times, most recently from 8d90cb7 to d6f01b5 Compare February 22, 2026 19:49
@tqchen

tqchen commented Feb 22, 2026

Copy link
Copy Markdown
Member Author

@tvm-bot rerun

@tqchen

tqchen commented Feb 22, 2026

Copy link
Copy Markdown
Member Author

@tvm-bot rerun

@tqchen tqchen force-pushed the ruff-lint-cleanup branch 5 times, most recently from cd5f289 to 763f145 Compare February 23, 2026 03:01
This PR modernizes the ruff linting configuration for TVM:

- Remove broad global rule ignores from pyproject.toml
- Move suppressed lint rules to per-file `# ruff: noqa:` comments
- Keep only `__init__.py` per-file-ignores in pyproject.toml
- Global ignores limited to UP006/UP007/UP035/UP045 (need future annotations)
  and RUF043/RUF059 (preview rules)
@tqchen tqchen merged commit 33dcea1 into apache:main Feb 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants