gemini-code-assist[bot] commented on PR #18779: URL: https://github.com/apache/tvm/pull/18779#issuecomment-3902927878
## Summary of Changes Hello @tqchen, I'm Gemini Code Assist[^1]! 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 extensive refactoring effort modernizes the TVM project by removing its reliance on the `dmlc-core` library. By internalizing core functionalities such as JSON processing, binary I/O, and thread-local storage, the pull request enhances code maintainability, reduces external dependencies, and simplifies the overall architecture. This change also cleans up build configurations and replaces DMLC-specific macros with TVM's own equivalents, contributing to a more self-contained and robust system. ### Highlights * **DMLC-core Dependency Removal**: The primary goal of this pull request is to eliminate the external dependency on `dmlc-core` by internalizing its functionalities within TVM's own `ffi` and `support` libraries. This significantly reduces the project's external footprint and simplifies its build process. * **Standardized JSON Handling**: All usages of `dmlc/json.h` have been replaced with `tvm/ffi/extra/json.h`, standardizing JSON serialization and deserialization across the codebase using TVM's internal FFI mechanisms. This includes updates to various configuration and graph serialization logic. * **Internalized I/O Utilities**: The I/O related features previously provided by `dmlc/io.h` and `dmlc/serializer.h` are now handled by newly introduced `tvm/support/io.h` and `tvm/support/serializer.h`. This provides a consistent and controlled I/O interface within the TVM project. * **Thread-Local Storage Migration**: Existing `dmlc::ThreadLocalStore` implementations have been migrated to `static thread_local` variables or equivalent TVM-specific thread-local storage patterns, ensuring proper thread-safety and resource management without relying on `dmlc-core`. * **Build System Simplification**: Various build configurations across CMakeLists.txt, Makefiles, and project files (e.g., Android.mk, iOS .pbxproj) have been updated to remove DMLC-specific paths, options, and compile definitions, streamlining the build system. 🧠**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](https://codeassist.google/code-review/login) to enable Memory in your admin console.** <details> <summary><b>Changelog</b></summary> * **3rdparty/nvbench/l2_cache_flush.h** * Replaced `dmlc/logging.h` with `tvm/runtime/logging.h`. * **CMakeLists.txt** * Removed DMLC-related paths, options, compile definitions, and install rules. * Replaced `DMLC_LOG_BEFORE_THROW` with `TVM_LOG_BEFORE_THROW`. * **Makefile** * Removed DMLC_CORE_PATH definition and references in include flags and jnilint target. * **apps/android_rpc/app/src/main/jni/Android.mk** * Removed DMLC include path. * **apps/android_rpc/app/src/main/jni/tvm_runtime.h** * Removed `DMLC_USE_LOGGING_LIBRARY` macro definition. * **apps/cpp_rpc/CMakeLists.txt** * Removed DMLC_PATH from target include directories. * **apps/cpp_rpc/main.cc** * Removed `dmlc::InitLogging` calls. * **apps/cpp_rpc/rpc_env.cc** * Replaced `dmlc::BeginPtr(bin)` with `bin.data()` for vector access. * **apps/cpp_rpc/rpc_server.cc** * Removed `dmlc::InitLogging` call. * **apps/hexagon_launcher/cmake/HexagonLauncher.cmake** * Removed DMLC include path. * **apps/hexagon_launcher/cmake/android/CMakeLists.txt** * Removed `DMLC_USE_LOGGING_LIBRARY` definition. * **apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt** * Removed `DMLC_CXX11_THREAD_LOCAL` and `DMLC_USE_LOGGING_LIBRARY` definitions. * **apps/hexagon_launcher/launcher_core.cc** * Included `tvm/ffi/extra/json.h` and `algorithm`. * Replaced `dmlc::JSONReader` and `dmlc::JSONWriter` with `tvm::ffi::json` types and methods for JSON serialization/deserialization. * Updated `TensorConfig`, `ModelConfig`, `OutputConfig` to use new JSON types. * **apps/hexagon_launcher/launcher_core.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `Load` and `Save` methods in `TensorConfig`, `ModelConfig`, `OutputConfig` to use `tvm::ffi::json` types. * **apps/ios_rpc/tvmrpc.xcodeproj/project.pbxproj** * Removed DMLC-related preprocessor definitions and header search paths. * **cmake/modules/CUDA.cmake** * Removed `DMLC_USE_LOGGING_LIBRARY` compile definition. * **cmake/modules/LLVM.cmake** * Removed `DMLC_USE_FOPEN64` and `DMLC_ENABLE_RTTI` compile definitions. * **cmake/modules/LibInfo.cmake** * Removed `TVM_INFO_DMLC_PATH`. * **cmake/modules/contrib/CUTLASS.cmake** * Removed `DMLC_USE_LOGGING_LIBRARY` compile definitions. * **cmake/modules/contrib/MSCCLPP.cmake** * Removed `DMLC_USE_LOGGING_LIBRARY` compile definition. * **docs/Doxyfile** * Removed `DMLC_USE_CXX11` from PREDEFINED macros. * **include/tvm/ir/attrs.h** * Removed `dmlc/common.h`. * **include/tvm/ir/op.h** * Replaced `DMLC_ATTRIBUTE_UNUSED` with `TVM_ATTRIBUTE_UNUSED`. * **include/tvm/runtime/disco/session.h** * Added `#include <mutex>`. * **include/tvm/runtime/logging.h** * Removed `dmlc/common.h` and `dmlc/thread_local.h`. * Replaced `dmlc::Error` with `Error` in `LogFatal::Finalize`. * Replaced `DMLC_LOG_BEFORE_THROW` with `TVM_LOG_BEFORE_THROW`. * Migrated `dmlc::ThreadLocalStore<VLogContext>` to `static thread_local VLogContext`. * **include/tvm/runtime/module.h** * Removed `dmlc/io.h`. * **include/tvm/runtime/serializer.h** * Replaced DMLC includes and serializer specializations with `tvm/support/io.h` and `tvm/support/serializer.h`. * **include/tvm/runtime/tensor.h** * Replaced DMLC includes and stream types with `tvm/support/io.h` and `tvm/support/serializer.h`. * Replaced `DMLC_IO_NO_ENDIAN_SWAP` with `TVM_FFI_IO_NO_ENDIAN_SWAP` and `dmlc::ByteSwap` with `ffi::ByteSwap`. * **include/tvm/runtime/vm/executable.h** * Added `tvm/support/io.h` and `tvm/support/serializer.h`. * Updated stream types for `Save` and `Load` methods. * Replaced `DMLC_DECLARE_TRAITS` with `tvm::support::Serializer` specialization. * **include/tvm/s_tir/schedule/instruction.h** * Replaced `DMLC_ATTRIBUTE_UNUSED` with `TVM_ATTRIBUTE_UNUSED`. * **include/tvm/support/io.h** * Added new file defining `tvm::support::Stream` and `tvm::support::Serializer` base template. * **include/tvm/support/serializer.h** * Added new file defining `tvm::support::Serializer` specializations for various types. * **include/tvm/support/with.h** * Removed `dmlc/common.h`. * Changed `~With()` exception specification. * **include/tvm/target/tag.h** * Replaced `DMLC_ATTRIBUTE_UNUSED` with `TVM_ATTRIBUTE_UNUSED`. * **include/tvm/target/target_kind.h** * Replaced `DMLC_ATTRIBUTE_UNUSED` with `TVM_ATTRIBUTE_UNUSED`. * **python/tvm/contrib/hexagon/tools.py** * Removed DMLC include path and compile definition. * **python/tvm/libinfo.py** * Removed DMLC-related include path logic. * **python/tvm/relax/frontend/nn/extern.py** * Removed DMLC include path and compile definitions. * **src/arith/solve_linear_equation.cc** * Added `#include <unordered_set>`. * **src/contrib/msc/core/codegen/base_codegen.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `ConfigType::Load` to use `tvm::ffi::json`. * **src/contrib/msc/core/codegen/codegen_json.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/contrib/msc/core/codegen/codegen_json.h** * Added `tvm/ffi/extra/json.h`. * Updated `MSCCompileConfig::Load` to use `tvm::ffi::json`. * Updated `MSCJSONSerializer` constructor to use `tvm::ffi::json`. * **src/contrib/msc/core/codegen/codegen_utils.h** * Added `tvm/ffi/extra/json.h`. * Updated `CODEGEN_CONFIG_PARSE` macro to use `tvm::ffi::json` for parsing. * **src/contrib/msc/core/codegen/cpp_codegen.h** * Removed `dmlc/json.h`. * **src/contrib/msc/core/codegen/py_codegen.h** * Removed `dmlc/json.h`. * **src/contrib/msc/core/ir/graph.cc** * Replaced `dmlc::JSONReader` with `tvm::ffi::json` for parsing JSON strings in `FromJson` methods. * Replaced `dmlc::JSONWriter` with `tvm::ffi::json::Stringify` for JSON serialization. * **src/contrib/msc/core/ir/graph.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `JsonMSCTensor`, `JsonMSCJoint`, `JsonMSCPrim`, `JsonWeightJoint`, `JsonMSCGraph`, `JsonWeightGraph` to use `tvm::ffi::json` for `SaveToJSON` and `Load` methods. * **src/contrib/msc/core/ir/graph_builder.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `MSCRBuildConfig::LoadInputTypes` and `MSCRBuildConfig::Load` to use `tvm::ffi::json`. * Updated `GraphBuilder` constructor to use `tvm::ffi::json`. * **src/contrib/msc/core/ir/plugin.cc** * Added `namespace json = ::tvm::ffi::json;`. * Replaced `dmlc::JSONReader` with `tvm::ffi::json` for parsing JSON strings in `FromJson` methods. * **src/contrib/msc/core/ir/plugin.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `JsonPluginAttr`, `JsonPluginTensor`, `JsonPluginExtern`, `JsonPlugin` to use `tvm::ffi::json` for `SaveToJSON` and `Load` methods. * **src/contrib/msc/core/printer/msc_base_printer.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `MSCPrinterConfig::Load` and `MSCBasePrinter` constructor to use `tvm::ffi::json`. * **src/contrib/msc/core/transform/set_expr_name.cc** * Added `#include <set>`. * **src/contrib/msc/framework/tensorflow/codegen_utils.h** * Updated `TensorflowCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/tensorflow/config.h** * Updated `TensorflowCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/tensorrt/codegen_utils.h** * Updated `TensorRTCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/tensorrt/transform_tensorrt.cc** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `TensorRTTransConfig::Load` and `ParseConfig` to use `tvm::ffi::json`. * **src/contrib/msc/framework/torch/codegen_utils.h** * Updated `TorchCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/torch/config.h** * Updated `TorchCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/tvm/codegen_utils.h** * Updated `RelaxCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/framework/tvm/config.h** * Updated `RelaxCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/plugin/base_codegen.h** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Updated `BasePluginCodeGen` constructor to use `tvm::ffi::json`. * **src/contrib/msc/plugin/codegen_utils.h** * Added `tvm/ffi/extra/json.h`. * Updated `PLUGIN_CODEGEN_CONFIG_PARSE` macro to use `tvm::ffi::json`. * **src/contrib/msc/plugin/tensorrt_codegen.h** * Updated `TensorRTPluginCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/plugin/torch_codegen.h** * Updated `TorchPluginCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/contrib/msc/plugin/tvm_codegen.cc** * Removed DMLC include path from includes. * **src/contrib/msc/plugin/tvm_codegen.h** * Updated `TVMPluginCodeGenConfig::Load` to use `tvm::ffi::json`. * **src/ir/instrument.cc** * Removed `dmlc/thread_local.h`. * Added `#include <chrono>`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local` for `PassProfileThreadLocalEntry`. * **src/ir/transform.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local` for `PassContextThreadLocalEntry`. * **src/node/structural_hash.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/relax/analysis/var2value.cc** * Added `#include <map>`. * **src/relax/backend/contrib/clml/codegen.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/relax/backend/contrib/codegen_json/codegen_json.h** * Removed `dmlc/any.h` and `dmlc/json.h`. * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * Updated `GetJSON` to use `tvm::ffi::json::Stringify`. * Updated `Save` method to `SaveToJSON` and implemented JSON object construction. * **src/relax/backend/contrib/cublas/codegen.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/relax/backend/contrib/cudnn/codegen.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/relax/backend/contrib/nnapi/codegen.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/relax/backend/contrib/tensorrt/codegen.cc** * Replaced `std::vector<dmlc::any>` with `std::vector<std::any>`. * **src/relax/backend/vm/exec_builder.cc** * Added `#include <unordered_set>`. * **src/relax/ir/transform.cc** * Removed `dmlc/thread_local.h`. * **src/runtime/const_loader_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/contrib/clml/clml_runtime.cc** * Added `tvm/ffi/extra/json.h`, `tvm/support/io.h`, and `../../../support/bytes_io.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * Replaced `dmlc::MemoryStringStream` with `support::BytesInStream`. * Replaced `dmlc::JSONWriter` with `tvm::ffi::json` for `DebugDump`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream` for tuning cache. * **src/runtime/contrib/coreml/coreml_runtime.mm** * Added `../../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/contrib/cublas/cublas_utils.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/cudnn/cudnn_json_runtime.cc** * Added `return nullptr;` to a `LOG(FATAL)` path. * **src/runtime/contrib/cudnn/cudnn_utils.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/hipblas/hipblas_utils.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/json/json_node.h** * Replaced `dmlc/any.h`, `dmlc/json.h`, `dmlc/memory_io.h` with `tvm/ffi/extra/json.h`. * Replaced `dmlc::any` with `std::any`. * Updated `JSONGraphNodeEntry` to use `tvm::ffi::json` for `SaveToJSON` and `Load`. * Added helper functions for `std::any` to `tvm::ffi::json` conversion. * Updated `JSONGraphNode` to use `tvm::ffi::json` for `SaveToJSON` and `Load`. * **src/runtime/contrib/json/json_runtime.h** * Added `tvm/ffi/extra/json.h`, `tvm/support/io.h`, `../../../support/bytes_io.h`. * Added `return "";` to `DebugDump`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * Updated `LoadGraph` and `Load` to use `tvm::ffi::json`. * **src/runtime/contrib/miopen/miopen_utils.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/mps/mps_utils.h** * Removed `dmlc/thread_local.h`. * **src/runtime/contrib/mps/mps_utils.mm** * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/mrvl/mrvl_hw_runtime.cc** * Added `../../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/contrib/mrvl/mrvl_runtime.cc** * Added `../../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/contrib/msc/tensorrt_runtime.cc** * Removed `dmlc/parameter.h`. * **src/runtime/contrib/random/random.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/rocblas/rocblas.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/contrib/tensorrt/tensorrt_runtime.cc** * Replaced `dmlc/parameter.h` with `tvm/ffi/extra/json.h`. * Added `../../../support/env.h`. * Replaced `dmlc::GetEnv` with `support::GetEnv`. * Replaced `dmlc::JSONReader` with `tvm::ffi::json` for metadata loading. * Replaced `dmlc::JSONWriter` with `tvm::ffi::json` for metadata saving. * **src/runtime/cpu_device_api.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/cuda/cuda_device_api.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/cuda/cuda_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/cuda/l2_cache_flush.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/device_api.cc** * Added `#include <mutex>`. * **src/runtime/disco/loader.cc** * Added `return "";` to `GetSiblingPath`. * **src/runtime/disco/message_queue.h** * Replaced `dmlc/io.h` with `tvm/support/io.h`. * Updated `DiscoStreamMessageQueue` to inherit from `support::Stream` and use `support::Stream` types. * **src/runtime/disco/protocol.h** * Replaced `dmlc/io.h` and `dmlc/memory_io.h` with `tvm/support/io.h` and `tvm/support/serializer.h`. * Added `../../../support/bytes_io.h`. * Added `return 0;` to `GetFFIAnyProtocolBytes`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream` and `support::BytesInStream`. * Added `return "";` to `DiscoDebugObject::SaveToStr`. * **src/runtime/disco/threaded_session.cc** * Replaced `dmlc/io.h` with `tvm/support/io.h`. * Updated `DiscoThreadedMessageQueue` to inherit from `support::Stream` and use `support::Stream` types. * **src/runtime/file_utils.cc** * Replaced `dmlc/json.h` and `dmlc/memory_io.h` with `tvm/ffi/extra/json.h` and `tvm/support/io.h`. * Added `../support/bytes_io.h`. * Updated `FunctionInfo` to use `tvm::ffi::json` for JSON serialization/deserialization and `support::Stream` for binary serialization/deserialization. * Replaced `dmlc::MemoryStringStream` with `support::BytesInStream` and `support::BytesOutStream` for parameter loading/saving. * **src/runtime/file_utils.h** * Updated `LoadParams` and `SaveParams` to use `support::Stream`. * Updated `SimpleBinaryFileStream` to inherit from `support::Stream`. * **src/runtime/hexagon/hexagon_device_api.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/hexagon/hexagon_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream`. * **src/runtime/logging.cc** * Replaced `dmlc::StackTrace()` with `""` as fallback. * **src/runtime/meta_data.h** * Replaced `dmlc/io.h` and `dmlc/json.h` with `tvm/ffi/extra/json.h`, `tvm/support/io.h`, and `tvm/support/serializer.h`. * Updated `FunctionInfo` to use `tvm::ffi::json` for JSON methods and `support::Stream` for binary methods. * Replaced `DMLC_DECLARE_TRAITS` with `tvm::support::Serializer` specialization. * **src/runtime/metal/metal_device_api.mm** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/metal/metal_module.mm** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h`, `tvm/ffi/extra/json.h`, and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::JSONReader` with `support::BytesOutStream` and `tvm::ffi::json`. * **src/runtime/opencl/opencl_device_api.cc** * Removed `dmlc/parameter.h` and `dmlc/thread_local.h`. * Added `../../support/env.h`. * Replaced `dmlc::GetEnv` with `support::GetEnv`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/opencl/opencl_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/opencl/opencl_module_spirv.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream`. * **src/runtime/opencl/opencl_wrapper/opencl_wrapper.cc** * Removed `DMLC_USE_LOGGING_LIBRARY` macro. * **src/runtime/pack_args.h** * Added `TVM_FFI_UNREACHABLE();` to `GetArgConvertCode`. * **src/runtime/profiling.cc** * Replaced `dmlc/json.h` with `tvm/ffi/extra/json.h`. * Added mutex, set, unordered_set includes. * Updated `parse_metrics` and `Report::FromJSON` to use `tvm::ffi::json`. * **src/runtime/rocm/rocm_device_api.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/rocm/rocm_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/rpc/rpc_endpoint.cc** * Updated `RPCEndpoint::EventHandler` to inherit from `support::Stream`. * Removed `using Stream::ReadArray;` and `using Stream::WriteArray;`. * Replaced `DMLC_IO_NO_ENDIAN_SWAP` with `TVM_FFI_IO_NO_ENDIAN_SWAP` and `dmlc::ByteSwap` with `ffi::ByteSwap`. * Replaced `dmlc::BeginPtr` with `data()`. * Replaced `GetDataSize` with `ffi::GetDataSize`. * **src/runtime/rpc/rpc_pipe_impl.cc** * Replaced `dmlc::BeginPtr` with `data()`. * **src/runtime/rpc/rpc_socket_impl.cc** * Added `tvm/support/io.h` and `tvm/support/serializer.h`. * Updated `SimpleSockHandler` to inherit from `support::Stream`. * **src/runtime/spirv/spirv_shader.h** * Replaced `dmlc/io.h` with `tvm/support/io.h` and `tvm/support/serializer.h`. * Updated `SPIRVShader` to use `support::Stream`. * Replaced `DMLC_DECLARE_TRAITS` with `tvm::support::Serializer` specialization. * **src/runtime/static_library.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h`, `tvm/support/serializer.h`, and `../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/runtime/thread_pool.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/runtime/thread_storage_scope.h** * Added `return "";` to `StorageScope::to_string`. * **src/runtime/vm/executable.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Updated `SaveHeader` and `LoadHeader` to use `support::Stream`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * Updated `VMFuncInfo` and `VMExecutable` methods to use `support::Stream`. * **src/runtime/vm/tensor_cache_support.cc** * Replaced `dmlc::Error` with `std::runtime_error` in catch block. * **src/runtime/vulkan/vulkan_device.cc** * Replaced `dmlc::BeginPtr` with `data()`. * Added `return 0;` to `FindMemoryType`. * **src/runtime/vulkan/vulkan_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesInStream`. * **src/runtime/vulkan/vulkan_wrapped_func.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream`. * **src/s_tir/analysis/sblock_access_region_detector.cc** * Added `#include <unordered_set>`. * **src/s_tir/meta_schedule/mutator/mutate_parallel.cc** * Added `#include <map>`. * **src/s_tir/meta_schedule/postproc/disallow_async_strided_mem_copy.cc** * Replaced `dmlc::Error` with `std::runtime_error` in catch block. * **src/s_tir/meta_schedule/postproc/verify_gpu_code.cc** * Replaced `dmlc::Error` with `std::runtime_error`. * **src/s_tir/meta_schedule/search_strategy/evolutionary_search.cc** * Added `#include <mutex>`. * **src/s_tir/meta_schedule/utils.h** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h`, `tvm/support/serializer.h`, and `../../support/bytes_io.h`. * Updated `Base64Encode` and `Base64Decode` to use `support::BytesOutStream` and `support::BytesInStream`. * **src/s_tir/schedule/primitive/hide_buffer_access.cc** * Added `#include <set>`. * **src/s_tir/schedule/primitive/reorder_block_iter_var.cc** * Added `#include <set>`. * **src/s_tir/transform/inject_software_pipeline.cc** * Added `#include <map>`. * **src/s_tir/transform/lower_async_dma.cc** * Added `#include <set>`. * **src/s_tir/transform/merge_shared_memory_allocations.cc** * Added `#include <list>` and `#include <map>`. * **src/s_tir/transform/using_assume_to_reduce_branches.cc** * Added `#include <map>`. * **src/script/printer/doc_printer/python_doc_printer.cc** * Added `#include <map>`. * **src/support/base64.h** * Added `tvm/support/io.h`. * Updated `StreamBufferReader`, `Base64InStream`, `Base64OutStream` to use `tvm::support::Stream`. * Added `return 0;` to `Write` and `Read` methods in `Base64InStream` and `Base64OutStream` respectively. * **src/support/bytes_io.h** * Added new file defining `tvm::support::BytesInStream` and `tvm::support::BytesOutStream`. * **src/support/env.h** * Added new file defining `tvm::support::GetEnv` for environment variable access. * **src/support/libinfo.cc** * Removed `DMLC_PATH` from `GetLibInfo`. * **src/support/pipe.h** * Replaced `dmlc/io.h` with `tvm/support/io.h`. * Updated `Pipe` to inherit from `tvm::support::Stream`. * **src/support/socket.h** * Replaced `dmlc/io.h` with `tvm/support/io.h`. * Updated `TCPSocket` to inherit from `tvm::support::Stream`. * **src/target/codegen.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h`, `tvm/support/serializer.h`, and `../support/bytes_io.h`. * Updated `ModuleSerializer` and global functions to use `support::Stream`. * **src/target/llvm/codegen_hexagon.cc** * Replaced `DMLC_ATTRIBUTE_UNUSED` with `TVM_ATTRIBUTE_UNUSED`. * **src/target/llvm/llvm_instance.cc** * Removed `dmlc/base.h`. * Replaced `DMLC_ATTRIBUTE_UNUSED` with `[[maybe_unused]]`. * **src/target/llvm/llvm_module.cc** * Removed `dmlc/io.h`. * Added `tvm/support/io.h`. * **src/target/source/codegen_webgpu.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/ffi/extra/json.h`, `tvm/support/io.h`, and `../../support/bytes_io.h`. * Added `return std::nullopt;` to `GetFunction`. * Replaced `dmlc::MemoryStringStream` with `support::BytesOutStream`. * Updated `InspectSource` to use `tvm::ffi::json`. * **src/target/source/source_module.cc** * Removed `dmlc/memory_io.h`. * Added `tvm/support/io.h` and `../../support/bytes_io.h`. * Replaced `dmlc::MemoryStringStream` and `dmlc::MemoryFixedSizeStream` with `support::BytesOutStream` and `support::BytesInStream`. * **src/target/spirv/spirv_utils.cc** * Replaced `dmlc::BeginPtr` with `data()`. * **src/target/target.cc** * Removed `dmlc/thread_local.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * **src/tir/ir/buffer.cc** * Added `#include <list>`. * **src/tir/transform/storage_rewrite.cc** * Added `#include <list>`. * **src/topi/einsum.cc** * Added `#include <map>` and `#include <set>`. * **tests/lint/cpplint.sh** * Commented out DMLC-based cpplint. * **tests/lint/jnilint.sh** * Commented out DMLC-based jnilint. * **tests/python/relax/test_frontend_nn_extern_module.py** * Removed DMLC-related compile definitions. * **web/Makefile** * Removed DMLC include path. * **web/emcc/tvmjs_support.cc** * Removed `DMLC_USE_LOGGING_LIBRARY` macro. * Added `#include <unordered_set>`. * **web/emcc/wasm_runtime.cc** * Removed `DMLC_USE_LOGGING_LIBRARY` macro. * **web/emcc/webgpu_runtime.cc** * Removed `DMLC_USE_LOGGING_LIBRARY` macro and `dmlc/memory_io.h`. * Added `tvm/ffi/extra/json.h` and `../../src/support/bytes_io.h`. * Migrated `dmlc::ThreadLocalStore` to `static thread_local`. * Updated `WebGPUModuleNode::GetFunction` to use `tvm::ffi::json`. </details> <details> <summary><b>Using Gemini Code Assist</b></summary> <br> The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips. <b>Invoking Gemini</b> 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. <b>Customization</b> 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](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). <b>Limitations & Feedback</b> Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: 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](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG). <b>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](https://cloud.google.com/products/gemini/code-assist).</b> </details> [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
