diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f987fa0103c4..a1f9455fb4ea 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,6 +16,7 @@ **/library/include/ @ROCm/rocm-documentation # Project-specific ownership +/dnn-providers/miopen-provider/ @ROCm/hipdnn-reviewers /projects/composablekernel/ @illsilin @carlushuang @qianfengz @aosewski @poyenc @geyyer @bartekxk @andriy-ca @afagaj @asleepzzz @tenpercent @ThomasNing @coderfeli /projects/hipblas/ @ROCm/hipblas-reviewers /projects/hipblas-common/ @ROCm/hipblas-common-reviewers diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6fb9e03cb542..f188c8d75c71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,8 @@ repos: - id: check-yaml exclude: | (?x) - ^projects/hipdnn/\.clang-format$ + ^projects/hipdnn/\.clang-format$| + ^dnn-providers/miopen-provider/\.clang-format$ - id: check-added-large-files - repo: https://github.com/psf/black diff --git a/dnn-providers/miopen-provider/.clang-format b/dnn-providers/miopen-provider/.clang-format new file mode 100644 index 000000000000..34872559fcf3 --- /dev/null +++ b/dnn-providers/miopen-provider/.clang-format @@ -0,0 +1,125 @@ +# Style file for MLSE Libraries based on the modified rocBLAS style + +# Common settings +BasedOnStyle: WebKit +TabWidth: 4 +IndentWidth: 4 +UseTab: Never +ColumnLimit: 100 + +# Other languages JavaScript, Proto + +--- +Language: Cpp + +# http://releases.llvm.org/6.0.1/tools/clang/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code +# int formatted_code; +# // clang-format off +# void unformatted_code ; +# // clang-format on +# void formatted_code_again; + +DisableFormat: false +Standard: Cpp11 + +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: false +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: false + +# Configure each individual brace in BraceWrapping +BreakBeforeBraces: Custom +# Control of individual brace wrapping cases +BraceWrapping: { + AfterCaseLabel: 'true' + AfterClass: 'true' + AfterControlStatement: 'true' + AfterEnum : 'true' + AfterFunction : 'true' + AfterNamespace : 'true' + AfterStruct : 'true' + AfterUnion : 'true' + BeforeCatch : 'true' + BeforeElse : 'true' + IndentBraces : 'false' +# AfterExternBlock : 'true' +} + +#BreakAfterJavaFieldAnnotations: true +#BreakBeforeInheritanceComma: false +#BreakBeforeBinaryOperators: None +#BreakBeforeTernaryOperators: true +#BreakConstructorInitializersBeforeComma: true +#BreakStringLiterals: true + +CommentPragmas: '^ IWYU pragma:' +#CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +SpaceBeforeCpp11BracedList: false +DerivePointerAlignment: false +ExperimentalAutoDetectBinPacking: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IndentCaseLabels: false +IndentPPDirectives: None +#FixNamespaceComments: true +IndentWrappedFunctionNames: true +InsertNewlineAtEOF: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +#JavaScriptQuotes: Double +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 4 +#ObjCSpaceAfterProperty: true +#ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 + +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: Never +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +#SpaceAfterTemplateKeyword: true +#SpaceBeforeInheritanceColon: true + +#SortUsingDeclarations: true +SortIncludes: true + +# Comments are for developers, they should arrange them +ReflowComments: false + +#IncludeBlocks: Preserve +--- diff --git a/dnn-providers/miopen-provider/.clang-tidy b/dnn-providers/miopen-provider/.clang-tidy new file mode 100644 index 000000000000..6cf92b3fbedc --- /dev/null +++ b/dnn-providers/miopen-provider/.clang-tidy @@ -0,0 +1,54 @@ +# Copyright © Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT + +Checks: > + -*, + bugprone-* + misc-*, + modernize-*, + performance-*, + portability-*, + readability-*, + google-global-names-in-headers, + -fuchsia-trailing-return, + -modernize-use-trailing-return-type, + -modernize-concat-nested-namespaces, + -modernize-use-nodiscard, + -modernize-use-using, + -performance-enum-size, + -readability-magic-numbers, + -readability-identifier-length, + -readability-qualified-auto, + -readability-uppercase-literal-suffix, + -readability-avoid-unconditional-preprocessor-if, + -readability-use-anyofallof, + -readability-function-cognitive-complexity + +WarningsAsErrors: "*" +HeaderFileExtensions: ['h','hpp'] + +# This regex is a inclusion filter for the files to be checked. Its a Posix regex and +# does not seem to support negative lookahead. +HeaderFilterRegex: '.' +ExcludeHeaderFilterRegex: '^(.*data_objects.*)$' + +CheckOptions: + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.FunctionCase, value: camelBack } + - { key: readability-identifier-naming.VariableCase, value: camelBack } + - { key: readability-identifier-naming.ParameterCase, value: camelBack } + - { key: readability-identifier-naming.MemberCase, value: camelBack } + - { key: readability-identifier-naming.PrivateMemberCase, value: camelBack } + - { key: readability-identifier-naming.ProtectedMemberPrefix, value: _ } + - { key: readability-identifier-naming.PrivateMemberPrefix, value: _ } + - { key: readability-identifier-naming.EnumCase, value: CamelCase } + - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } + - { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE } + - { key: readability-identifier-naming.StaticVariablePrefix, value: s_ } + # Ignore hipdnnHandle name everywhere (required for public API compatibility) + - { key: readability-identifier-naming.StructIgnoredRegexp, value: "hipdnnHandle" } + - { key: readability-identifier-naming.ClassIgnoredRegexp, value: "hipdnnHandle" } + - { key: readability-identifier-naming.TypedefIgnoredRegexp, value: "hipdnnHandle" } diff --git a/dnn-providers/miopen-provider/.clinerules b/dnn-providers/miopen-provider/.clinerules new file mode 100644 index 000000000000..56ff8ae37bc9 --- /dev/null +++ b/dnn-providers/miopen-provider/.clinerules @@ -0,0 +1,226 @@ +# Cline Rules for MIOpen Provider Plugin + +## Project Overview + +MIOpen Provider is a hipDNN plugin that wraps AMD's MIOpen library to provide GPU-accelerated deep learning operations. This plugin implements the hipDNN Plugin SDK interface to expose MIOpen kernels as execution engines. + +**hipDNN Context**: hipDNN is a graph-based deep learning library for AMD GPUs with a plugin-based architecture. Plugins like this one implement the Plugin SDK to provide engine implementations that execute operation graphs. + +### Key Documentation +- **[Plugin README](./README.md)** - Build instructions and overview +- **[Operation Support](./docs/OperationSupport.md)** - Supported operations and data types +- **[hipDNN Plugin Development Guide](../../projects/hipdnn/docs/PluginDevelopment.md)** - Plugin SDK reference +- **[Plugin SDK Headers](../../projects/hipdnn/plugin_sdk/include/hipdnn_plugin_sdk/)** - API definitions + +### Plugin Architecture + +This plugin implements the hipDNN Plugin SDK interfaces: + +| Component | Purpose | +|-----------|---------| +| **Plugin API** (`PluginApi.h`) | Plugin metadata (name, version, type), error reporting, logging | +| **Engine Plugin API** (`EnginePluginApi.h`) | Engine lifecycle (create, configure, execute graphs) | +| **IEngine** | Engine interface - checks graph applicability, creates execution plans | +| **IPlanBuilder** | Builds execution plans for specific operation types | +| **IPlan** | Executable plan that runs on GPU using MIOpen kernels | +| **Data SDK** | FlatBuffer schemas for serialization, logging utilities | + +**Execution Flow**: Graph (FlatBuffer) → Engine Selection (isApplicable) → Plan Creation (IPlanBuilder) → Execution (IPlan::execute) + +**Component Linkage (Do Not Modify)**: +- Plugin uses: Plugin SDK (header-only), Data SDK (header-only), MIOpen library +- Plugin SDK uses: Data SDK +- No direct dependencies on hipDNN Backend or Frontend + +--- + +## Building & Testing + +### Build Commands + +**Building as part of hipDNN**: +```bash +# From hipDNN root directory +cd /projects/hipdnn +mkdir -p build && cd build +cmake -GNinja .. +ninja # Plugin built by default +``` + +**Building standalone** (requires hipDNN and MIOpen installed): +```bash +# From workspace root, navigate to plugin directory +cd /dnn-providers/miopen-provider +mkdir -p build && cd build +cmake -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ .. +ninja +``` + +See [Plugin README](./README.md) for detailed build instructions. + +### Test Binaries + +Plugin-specific test binaries (in `build/bin/` when building from hipDNN root): + +| Binary | Tests | Typical Use | +|--------|-------|-------------| +| `miopen_legacy_plugin_tests` | Plugin unit tests | Engine manager, plan builders, MIOpen integration | +| `miopen_plugin_integration_test` | GPU integration tests | End-to-end operation execution | + +### Running Specific Tests with `--gtest_filter` + +**Use `--gtest_filter` when iterating on specific functionality:** +```bash +# From hipDNN build directory +./bin/miopen_legacy_plugin_tests --gtest_filter="TestMiopenEngine.*" + +# Run a specific test case +./bin/miopen_plugin_integration_test --gtest_filter="IntegrationGpuConvolutionFwdFp32.*" +``` + +### When Modifying Code + +**Only build or run tests if explicitly requested in the user's prompt.** Do not proactively run `ninja`, test binaries, or build commands unless asked. + +When requested to build/test: +1. Rebuild with `ninja` (from build directory) +2. Run relevant tests using `--gtest_filter` for fast iteration + +--- + +## C++ Code Style + +### Naming Conventions +- Use CamelCase for class and struct names (e.g., `MiopenEngine`, `ConvolutionPlanBuilder`) +- Use camelBack for functions, variables, and private members (e.g., `buildPlan()`, `engineId`) +- Prefix private members with underscore (e.g., `_miopenHandle`, `_planBuilders`) + +### File Headers +- Always add copyright header to all source files: + ```cpp + // Copyright © Advanced Micro Devices, Inc., or its affiliates. + // SPDX-License-Identifier: MIT + ``` +- For header files (.h, .hpp), add `#pragma once` immediately after copyright + +### Code Practices +- Use `auto` when initializing with a cast to avoid duplicating the type name + ```cpp + // Good + auto tensor = static_cast(data); + // Avoid + float* tensor = static_cast(data); + ``` +- Use auto when initializing variables, unless the type is not obvious. +- **Avoid implicit casts** - use explicit `static_cast<>` for type conversions. The codebase compiles with `-Wconversion` and `-Wsign-conversion` which will error on implicit narrowing or sign conversions. +- Always use {}'s for if/for/while bodies, even if single line + ```cpp + // Good + if(condition) + { + doSomething(); + } + // Avoid + if(condition) doSomething(); + ``` + +### Build System +- Always use CMake for managing C/C++ dependencies +- When discussing dependencies or build configuration, provide CMake-based solutions + +### Serialization +- Use Flatbuffers for serialization needs (via Data SDK) +- Access FlatBuffer data via Data SDK wrapper classes (IGraph, GraphWrapper, etc.) + +### Testing +- Use Google Test (gtest) framework for all C/C++ tests +- Never generate a main() function in test files - gtest provides its own +- Use TEST(), TEST_F(), or TEST_P() macros as appropriate + +#### Test Naming Guidelines + +Rules below apply ONLY to the TestSuite name (first parameter of `TEST` / `TEST_F` / `TEST_P`). The TestCase (second parameter) can be descriptive but should still avoid the reserved keywords where noted. +TestCase should be PascalCase. + +**Ordering & Composition (left → right):** + +1. Optional `Integration` prefix for integration tests. +2. Optional `Gpu` (immediately after `Integration` if both apply) for GPU-required tests. +3. Core Feature / Subject under test (PascalCase, no underscores). +4. Optional Datatype token (`Bfp16`, `Fp16`, `Fp32`) at the end. + +Omit any category that does not apply. + +### Keywords (reserved positions) + +- **Integration** (only for integration tests, always first if present). +- **Gpu** (always first unless preceded by Integration). +- **Datatypes**: Bfp16, Fp16, Fp32. + +### Unit Tests + +In most cases unit style tests should be named so they directly mirror the class under test. If the class is named `MyClass`, then the test suite should be named `TestMyClass`. In general these kinds of tests should try to avoid using anything that requires Gpu support. This is not always possible, in the cases where Gpu support is required, the test suite should be named `GpuTestMyClass`. + +### Valid Examples + +```cpp +IntegrationGpuConvolutionFwdFp32 +GpuTestMiopenEngineFp32 +TestMiopenEngineManager +TestConvolutionPlanBuilder +``` + +## Example Code Structure + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#pragma once // For header files only + +#include +#include + +// Class names in PascalCase +class MiopenPlanBuilder +{ +public: + // Public methods in camelCase + void buildPlan(); + size_t getWorkspaceSize() const; + +private: + // Private members prefixed with _ + miopenHandle_t _handle; + std::vector _data; +}; + +// Functions in camelCase +void executePlan(const MiopenPlanBuilder& builder); +``` + +## Test File Example + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#include + +class TestMiopenEngine : public ::testing::Test +{ +protected: + void SetUp() override + { + // Setup code + } + +private: + miopenHandle_t _handle; +}; + +TEST_F(TestMiopenEngine, CreatesValidEngine) +{ + // Test implementation +} +``` diff --git a/dnn-providers/miopen-provider/.cursor/rules/building.mdc b/dnn-providers/miopen-provider/.cursor/rules/building.mdc new file mode 100644 index 000000000000..2f9980e0e5de --- /dev/null +++ b/dnn-providers/miopen-provider/.cursor/rules/building.mdc @@ -0,0 +1,75 @@ +--- +alwaysApply: false +--- + +# Building & Testing MIOpen Provider Plugin + +**Only build or run tests if explicitly requested in the user's prompt.** Do not proactively run `ninja`, test binaries, or build commands unless asked. + +## Build Commands + +### Building as Part of hipDNN + +```bash +# From hipDNN root directory +cd /projects/hipdnn +mkdir -p build && cd build + +# Configure (one-time or after CMakeLists changes) +cmake -GNinja .. + +# Build everything (plugin included by default) +ninja +``` + +### Building Standalone + +Requires hipDNN and MIOpen already installed on the system. + +```bash +# From workspace root, navigate to plugin directory +cd /dnn-providers/miopen-provider +mkdir -p build && cd build + +# Configure with AMD clang++ +cmake -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ .. + +# Build plugin +ninja + +# Run tests +ninja test +``` + +See [Plugin README](../README.md) for detailed build instructions. + +## Test Binaries + +Plugin-specific test binaries (in `build/bin/` when building from hipDNN root): + +| Binary | Tests | Typical Use | +|--------|-------|-------------| +| `miopen_legacy_plugin_tests` | Plugin unit tests | Engine manager, plan builders, MIOpen integration | +| `miopen_plugin_integration_test` | GPU integration tests | End-to-end operation execution on GPU | + +## Running Specific Tests with `--gtest_filter` + +**Use `--gtest_filter` when iterating on specific functionality:** + +```bash +# From hipDNN build directory +./bin/miopen_legacy_plugin_tests --gtest_filter="TestMiopenEngine.*" + +# Run a specific test case +./bin/miopen_plugin_integration_test --gtest_filter="IntegrationGpuConvolutionFwdFp32.*" + +# Run tests matching a pattern +./bin/miopen_legacy_plugin_tests --gtest_filter="*Batchnorm*" +``` + +## When Modifying Code + +When requested to build/test: +1. Rebuild with `ninja` (from build directory) +2. Run relevant tests using `--gtest_filter` for fast iteration +3. Use plugin-specific test binaries listed above diff --git a/dnn-providers/miopen-provider/.cursor/rules/cpp-style.mdc b/dnn-providers/miopen-provider/.cursor/rules/cpp-style.mdc new file mode 100644 index 000000000000..dcefd46b52e1 --- /dev/null +++ b/dnn-providers/miopen-provider/.cursor/rules/cpp-style.mdc @@ -0,0 +1,81 @@ +--- +globs: ["*.cpp", "*.hpp", "*.h", "*.cxx", "*.cc"] +--- + +# C++ Code Style + +## Naming Conventions + +- Use CamelCase for class and struct names (e.g., `BatchNormTestCase`, `SimpleTensorBundle`) +- Use camelBack for functions, variables, and private members (e.g., `setupEnvironment()`, `tensorData`) +- Prefix private members with underscore (e.g., `_handle`, `_testData`) + +## File Headers + +- Always add copyright header to all source files: + ```cpp + // Copyright © Advanced Micro Devices, Inc., or its affiliates. + // SPDX-License-Identifier: MIT + ``` +- For header files (.h, .hpp), add `#pragma once` immediately after copyright + +## Code Practices + +- Use `auto` when initializing with a cast to avoid duplicating the type name + ```cpp + // Good + auto tensor = static_cast(data); + // Avoid + float* tensor = static_cast(data); + ``` +- Use auto when initializing variables, unless the type is not obvious. +- **Avoid implicit casts** - use explicit `static_cast<>` for type conversions. The codebase compiles with `-Wconversion` and `-Wsign-conversion` which will error on implicit narrowing or sign conversions. +- Always use {}'s for if/for/while bodies, even if single line + ```cpp + // Good + if(condition) + { + doSomething(); + } + // Avoid + if(condition) doSomething(); + ``` + +## Build System + +- Always use CMake for managing C/C++ dependencies +- When discussing dependencies or build configuration, provide CMake-based solutions + +## Serialization + +- Use Flatbuffers for serialization needs +- Provide Flatbuffer schema definitions when creating serializable data structures + +## Example Code Structure + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#pragma once // For header files only + +#include +#include + +// Class names in PascalCase +class MyTestClass +{ +public: + // Public methods in camelCase + void setupTest(); + int getValue() const; + +private: + // Private members prefixed with _ + int _testValue; + std::vector _data; +}; + +// Functions in camelCase +void processData(const MyTestClass& obj); +``` diff --git a/dnn-providers/miopen-provider/.cursor/rules/hipdnn-architecture.mdc b/dnn-providers/miopen-provider/.cursor/rules/hipdnn-architecture.mdc new file mode 100644 index 000000000000..d45c278868d7 --- /dev/null +++ b/dnn-providers/miopen-provider/.cursor/rules/hipdnn-architecture.mdc @@ -0,0 +1,56 @@ +--- +alwaysApply: true +--- + +# MIOpen Provider Plugin Architecture + +MIOpen Provider is a hipDNN plugin that wraps AMD's MIOpen library to provide GPU-accelerated deep learning operations. + +**hipDNN Context**: hipDNN is a graph-based deep learning library for AMD GPUs with a plugin architecture. Plugins implement the Plugin SDK to provide engine implementations that execute operation graphs. + +## Plugin SDK Interfaces + +This plugin implements the following hipDNN Plugin SDK interfaces: + +| Interface | File | Purpose | +|-----------|------|---------| +| **Plugin API** | `PluginApi.h` | Plugin metadata (name, version, type), error reporting, logging callbacks | +| **Engine Plugin API** | `EnginePluginApi.h` | Engine lifecycle - create handle, set stream, get engines, execute graphs | +| **IEngine** | `EngineInterface.hpp` | Engine interface - checks applicability, provides details, creates plans | +| **IPlanBuilder** | `PlanInterface.hpp` | Builds execution plans for specific operation patterns | +| **IPlan** | `PlanInterface.hpp` | Executable plan that runs operations on GPU | + +## Execution Flow + +``` +FlatBuffer Graph → Engine Selection → Plan Creation → GPU Execution + ↓ ↓ ↓ ↓ + IGraph API isApplicable() buildPlan() execute() +``` + +1. **Graph Analysis**: Backend deserializes FlatBuffer graph, queries plugins for applicable engines +2. **Engine Selection**: Plugin's `isApplicable()` checks if any plan builder can handle the graph +3. **Plan Building**: Selected plan builder creates concrete `IPlan` instance with MIOpen setup +4. **Execution**: Plan's `execute()` launches MIOpen kernels on GPU + +## Component Linkage (Do Not Modify) + +- **Plugin uses**: Plugin SDK (header-only), Data SDK (header-only), MIOpen library +- **Plugin SDK uses**: Data SDK +- **Data SDK uses**: FlatBuffers, spdlog +- **No direct dependencies** on hipDNN Backend or Frontend + +## Key Classes + +- **HipdnnEnginePluginHandle**: Plugin instance with MIOpen handle, stream, engine manager +- **EngineManager**: Manages available engines and routes requests to applicable engines +- **MiopenEngine**: Concrete engine with multiple plan builders for different operations +- **HipdnnEnginePluginExecutionContext**: Stores the execution plan for a graph +- **Plan Builders**: `MiopenConvPlanBuilder`, `MiopenBatchnormPlanBuilder`, etc. +- **Plans**: `MiopenConvFwdPlan`, `MiopenBatchnormFwdPlan`, etc. + +## Documentation + +- [Plugin SDK Reference](../../../projects/hipdnn/docs/PluginDevelopment.md) +- [Operation Support](../docs/OperationSupport.md) +- [Plugin API Headers](../../../projects/hipdnn/plugin_sdk/include/hipdnn_plugin_sdk/) diff --git a/dnn-providers/miopen-provider/.cursor/rules/testing.mdc b/dnn-providers/miopen-provider/.cursor/rules/testing.mdc new file mode 100644 index 000000000000..44d7b662190b --- /dev/null +++ b/dnn-providers/miopen-provider/.cursor/rules/testing.mdc @@ -0,0 +1,72 @@ +--- +globs: ["*.cpp", "*.hpp", "*.h"] +--- + +# Testing Guidelines + +## Framework + +- Use Google Test (gtest) framework for all C/C++ tests +- Never generate a main() function in test files - gtest provides its own +- Use TEST(), TEST_F(), or TEST_P() macros as appropriate + +## Test Naming Guidelines + +Rules below apply ONLY to the TestSuite name (first parameter of `TEST` / `TEST_F` / `TEST_P`). The TestCase (second parameter) can be descriptive but should still avoid the reserved keywords where noted. TestCase should be PascalCase. + +### Ordering & Composition (left → right) + +1. Optional `Integration` prefix for integration tests. +2. Optional `Gpu` (immediately after `Integration` if both apply) for GPU-required tests. +3. Core Feature / Subject under test (PascalCase, no underscores). +4. Optional Datatype token (`Bfp16`, `Fp16`, `Fp32`) at the end. + +Omit any category that does not apply. + +### Keywords (reserved positions) + +- **Integration** (only for integration tests, always first if present). +- **Gpu** (always first unless preceded by Integration). +- **Datatypes**: Bfp16, Fp16, Fp32. + +### Unit Tests + +In most cases unit style tests should be named so they directly mirror the class under test. If the class is named `MyClass`, then the test suite should be named `TestMyClass`. In general these kinds of tests should try to avoid using anything that requires Gpu support. This is not always possible, in the cases where Gpu support is required, the test suite should be named `GpuTestMyClass`. + +### Valid Examples + +```cpp +IntegrationGpuConvolutionPlannerNchwFp32 +GpuTestActivationKernelNchwFp32 +GpuTestExecutionPlanBuilderFp32 +GpuTestExecutionPlanBuilderNchw +IntegrationGraphFusion +TestConvolutionHeuristicsFp32 +TestConvolutionHeuristics +``` + +## Test File Example + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#include + +class MyTestFixture : public ::testing::Test +{ +protected: + void SetUp() override + { + // Setup code + } + +private: + int _testData; +}; + +TEST_F(MyTestFixture, TestSomething) +{ + // Test implementation +} +``` diff --git a/dnn-providers/miopen-provider/.gitattributes b/dnn-providers/miopen-provider/.gitattributes new file mode 100644 index 000000000000..dbdce96ec590 --- /dev/null +++ b/dnn-providers/miopen-provider/.gitattributes @@ -0,0 +1,6 @@ +*.db.bz2 binary +*.db.txt.bz2 binary +*.fdb.txt.bz2 binary +*.kdb.bz2 filter=lfs diff=lfs merge=lfs -text +*.ktn.model binary +*.zip filter=lfs diff=lfs merge=lfs -text diff --git a/dnn-providers/miopen-provider/.github/copilot-instructions.md b/dnn-providers/miopen-provider/.github/copilot-instructions.md new file mode 100644 index 000000000000..b6ae6de3fd6e --- /dev/null +++ b/dnn-providers/miopen-provider/.github/copilot-instructions.md @@ -0,0 +1,226 @@ +# Copilot Rules for MIOpen Provider Plugin + +## Project Overview + +MIOpen Provider is a hipDNN plugin that wraps AMD's MIOpen library to provide GPU-accelerated deep learning operations. This plugin implements the hipDNN Plugin SDK interface to expose MIOpen kernels as execution engines. + +**hipDNN Context**: hipDNN is a graph-based deep learning library for AMD GPUs with a plugin-based architecture. Plugins like this one implement the Plugin SDK to provide engine implementations that execute operation graphs. + +### Key Documentation +- **[Plugin README](../README.md)** - Build instructions and overview +- **[Operation Support](../docs/OperationSupport.md)** - Supported operations and data types +- **[hipDNN Plugin Development Guide](../../../projects/hipdnn/docs/PluginDevelopment.md)** - Plugin SDK reference +- **[Plugin SDK Headers](../../../projects/hipdnn/plugin_sdk/include/hipdnn_plugin_sdk/)** - API definitions + +### Plugin Architecture + +This plugin implements the hipDNN Plugin SDK interfaces: + +| Component | Purpose | +|-----------|---------| +| **Plugin API** (`PluginApi.h`) | Plugin metadata (name, version, type), error reporting, logging | +| **Engine Plugin API** (`EnginePluginApi.h`) | Engine lifecycle (create, configure, execute graphs) | +| **IEngine** | Engine interface - checks graph applicability, creates execution plans | +| **IPlanBuilder** | Builds execution plans for specific operation types | +| **IPlan** | Executable plan that runs on GPU using MIOpen kernels | +| **Data SDK** | FlatBuffer schemas for serialization, logging utilities | + +**Execution Flow**: Graph (FlatBuffer) → Engine Selection (isApplicable) → Plan Creation (IPlanBuilder) → Execution (IPlan::execute) + +**Component Linkage (Do Not Modify)**: +- Plugin uses: Plugin SDK (header-only), Data SDK (header-only), MIOpen library +- Plugin SDK uses: Data SDK +- No direct dependencies on hipDNN Backend or Frontend + +--- + +## Building & Testing + +### Build Commands + +**Building as part of hipDNN**: +```bash +# From hipDNN root directory +cd /projects/hipdnn +mkdir -p build && cd build +cmake -GNinja .. +ninja # Plugin built by default +``` + +**Building standalone** (requires hipDNN and MIOpen installed): +```bash +# From workspace root, navigate to plugin directory +cd /dnn-providers/miopen-provider +mkdir -p build && cd build +cmake -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ .. +ninja +``` + +See [Plugin README](../README.md) for detailed build instructions. + +### Test Binaries + +Plugin-specific test binaries (in `build/bin/` when building from hipDNN root): + +| Binary | Tests | Typical Use | +|--------|-------|-------------| +| `miopen_legacy_plugin_tests` | Plugin unit tests | Engine manager, plan builders, MIOpen integration | +| `miopen_plugin_integration_test` | GPU integration tests | End-to-end operation execution | + +### Running Specific Tests with `--gtest_filter` + +**Use `--gtest_filter` when iterating on specific functionality:** +```bash +# From hipDNN build directory +./bin/miopen_legacy_plugin_tests --gtest_filter="TestMiopenEngine.*" + +# Run a specific test case +./bin/miopen_plugin_integration_test --gtest_filter="IntegrationGpuConvolutionFwdFp32.*" +``` + +### When Modifying Code + +**Only build or run tests if explicitly requested in the user's prompt.** Do not proactively run `ninja`, test binaries, or build commands unless asked. + +When requested to build/test: +1. Rebuild with `ninja` (from build directory) +2. Run relevant tests using `--gtest_filter` for fast iteration + +--- + +## C++ Code Style + +### Naming Conventions +- Use CamelCase for class and struct names (e.g., `MiopenEngine`, `ConvolutionPlanBuilder`) +- Use camelBack for functions, variables, and private members (e.g., `buildPlan()`, `engineId`) +- Prefix private members with underscore (e.g., `_miopenHandle`, `_planBuilders`) + +### File Headers +- Always add copyright header to all source files: + ```cpp + // Copyright © Advanced Micro Devices, Inc., or its affiliates. + // SPDX-License-Identifier: MIT + ``` +- For header files (.h, .hpp), add `#pragma once` immediately after copyright + +### Code Practices +- Use `auto` when initializing with a cast to avoid duplicating the type name + ```cpp + // Good + auto tensor = static_cast(data); + // Avoid + float* tensor = static_cast(data); + ``` +- Use auto when initializing variables, unless the type is not obvious. +- **Avoid implicit casts** - use explicit `static_cast<>` for type conversions. The codebase compiles with `-Wconversion` and `-Wsign-conversion` which will error on implicit narrowing or sign conversions. +- Always use {}'s for if/for/while bodies, even if single line + ```cpp + // Good + if(condition) + { + doSomething(); + } + // Avoid + if(condition) doSomething(); + ``` + +### Build System +- Always use CMake for managing C/C++ dependencies +- When discussing dependencies or build configuration, provide CMake-based solutions + +### Serialization +- Use Flatbuffers for serialization needs (via Data SDK) +- Access FlatBuffer data via Data SDK wrapper classes (IGraph, GraphWrapper, etc.) + +### Testing +- Use Google Test (gtest) framework for all C/C++ tests +- Never generate a main() function in test files - gtest provides its own +- Use TEST(), TEST_F(), or TEST_P() macros as appropriate + +#### Test Naming Guidelines + +Rules below apply ONLY to the TestSuite name (first parameter of `TEST` / `TEST_F` / `TEST_P`). The TestCase (second parameter) can be descriptive but should still avoid the reserved keywords where noted. +TestCase should be PascalCase. + +**Ordering & Composition (left → right):** + +1. Optional `Integration` prefix for integration tests. +2. Optional `Gpu` (immediately after `Integration` if both apply) for GPU-required tests. +3. Core Feature / Subject under test (PascalCase, no underscores). +4. Optional Datatype token (`Bfp16`, `Fp16`, `Fp32`) at the end. + +Omit any category that does not apply. + +### Keywords (reserved positions) + +- **Integration** (only for integration tests, always first if present). +- **Gpu** (always first unless preceded by Integration). +- **Datatypes**: Bfp16, Fp16, Fp32. + +### Unit Tests + +In most cases unit style tests should be named so they directly mirror the class under test. If the class is named `MyClass`, then the test suite should be named `TestMyClass`. In general these kinds of tests should try to avoid using anything that requires Gpu support. This is not always possible, in the cases where Gpu support is required, the test suite should be named `GpuTestMyClass`. + +### Valid Examples + +```cpp +IntegrationGpuConvolutionFwdFp32 +GpuTestMiopenEngineFp32 +TestMiopenEngineManager +TestConvolutionPlanBuilder +``` + +## Example Code Structure + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#pragma once // For header files only + +#include +#include + +// Class names in PascalCase +class MiopenPlanBuilder +{ +public: + // Public methods in camelCase + void buildPlan(); + size_t getWorkspaceSize() const; + +private: + // Private members prefixed with _ + miopenHandle_t _handle; + std::vector _data; +}; + +// Functions in camelCase +void executePlan(const MiopenPlanBuilder& builder); +``` + +## Test File Example + +```cpp +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// SPDX-License-Identifier: MIT + +#include + +class TestMiopenEngine : public ::testing::Test +{ +protected: + void SetUp() override + { + // Setup code + } + +private: + miopenHandle_t _handle; +}; + +TEST_F(TestMiopenEngine, CreatesValidEngine) +{ + // Test implementation +} +``` diff --git a/dnn-providers/miopen-provider/.gitignore b/dnn-providers/miopen-provider/.gitignore new file mode 100644 index 000000000000..794bb6477554 --- /dev/null +++ b/dnn-providers/miopen-provider/.gitignore @@ -0,0 +1,82 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch +*.ipch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Hipdnn Local install +install/ + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# vim tags +tags +.tags +.*.swp + +# Editors +.vscode +.cline_storage + +#code ql +scripts*/codeql-*/ +scripts*/*_codeql_*/ + +# build-in-source directory + +# emacs temporary/backup files +.\#* +\#*\# +*~ + +# GDB temporary files +.gdb_history +install.dir* + +# documentation artifacts +_build/ +_images/ +_static/ +_templates/ +_toc.yml +_doxygen/ + +# JetBrains IDE +.idea/ +cmake-build*/ +build*/ +CMakeUserPresets.json + +# Python virtualenv +.venv/ +hipdnn_env/ + +# Python cache +__pycache__/ + +# Python egg +*.egg-info/ + +*.profraw diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/CMakeLists.txt b/dnn-providers/miopen-provider/CMakeLists.txt similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/CMakeLists.txt rename to dnn-providers/miopen-provider/CMakeLists.txt diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/EngineManager.cpp b/dnn-providers/miopen-provider/EngineManager.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/EngineManager.cpp rename to dnn-providers/miopen-provider/EngineManager.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/EngineManager.hpp b/dnn-providers/miopen-provider/EngineManager.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/EngineManager.hpp rename to dnn-providers/miopen-provider/EngineManager.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/HipdnnEnginePluginExecutionContext.hpp b/dnn-providers/miopen-provider/HipdnnEnginePluginExecutionContext.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/HipdnnEnginePluginExecutionContext.hpp rename to dnn-providers/miopen-provider/HipdnnEnginePluginExecutionContext.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/HipdnnEnginePluginHandle.hpp b/dnn-providers/miopen-provider/HipdnnEnginePluginHandle.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/HipdnnEnginePluginHandle.hpp rename to dnn-providers/miopen-provider/HipdnnEnginePluginHandle.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenActivationDescriptor.cpp b/dnn-providers/miopen-provider/MiopenActivationDescriptor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenActivationDescriptor.cpp rename to dnn-providers/miopen-provider/MiopenActivationDescriptor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenActivationDescriptor.hpp b/dnn-providers/miopen-provider/MiopenActivationDescriptor.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenActivationDescriptor.hpp rename to dnn-providers/miopen-provider/MiopenActivationDescriptor.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenContainer.cpp b/dnn-providers/miopen-provider/MiopenContainer.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenContainer.cpp rename to dnn-providers/miopen-provider/MiopenContainer.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenContainer.hpp b/dnn-providers/miopen-provider/MiopenContainer.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenContainer.hpp rename to dnn-providers/miopen-provider/MiopenContainer.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenConvDescriptor.cpp b/dnn-providers/miopen-provider/MiopenConvDescriptor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenConvDescriptor.cpp rename to dnn-providers/miopen-provider/MiopenConvDescriptor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenConvDescriptor.hpp b/dnn-providers/miopen-provider/MiopenConvDescriptor.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenConvDescriptor.hpp rename to dnn-providers/miopen-provider/MiopenConvDescriptor.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenHandleFactory.cpp b/dnn-providers/miopen-provider/MiopenHandleFactory.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenHandleFactory.cpp rename to dnn-providers/miopen-provider/MiopenHandleFactory.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenHandleFactory.hpp b/dnn-providers/miopen-provider/MiopenHandleFactory.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenHandleFactory.hpp rename to dnn-providers/miopen-provider/MiopenHandleFactory.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp b/dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp rename to dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPlugin.hpp b/dnn-providers/miopen-provider/MiopenLegacyPlugin.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPlugin.hpp rename to dnn-providers/miopen-provider/MiopenLegacyPlugin.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPluginPublic.cpp b/dnn-providers/miopen-provider/MiopenLegacyPluginPublic.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenLegacyPluginPublic.cpp rename to dnn-providers/miopen-provider/MiopenLegacyPluginPublic.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenTensor.cpp b/dnn-providers/miopen-provider/MiopenTensor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenTensor.cpp rename to dnn-providers/miopen-provider/MiopenTensor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenTensor.hpp b/dnn-providers/miopen-provider/MiopenTensor.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenTensor.hpp rename to dnn-providers/miopen-provider/MiopenTensor.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenUtils.cpp b/dnn-providers/miopen-provider/MiopenUtils.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenUtils.cpp rename to dnn-providers/miopen-provider/MiopenUtils.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/MiopenUtils.hpp b/dnn-providers/miopen-provider/MiopenUtils.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/MiopenUtils.hpp rename to dnn-providers/miopen-provider/MiopenUtils.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/README.md b/dnn-providers/miopen-provider/README.md similarity index 86% rename from projects/hipdnn/plugins/miopen_legacy_plugin/README.md rename to dnn-providers/miopen-provider/README.md index 98d0097f9883..5b9c4da7d7bc 100644 --- a/projects/hipdnn/plugins/miopen_legacy_plugin/README.md +++ b/dnn-providers/miopen-provider/README.md @@ -5,13 +5,13 @@ A plugin wrapping MIOpen in order to provide engines to solve some hipDNN graphs This plugin can be built as part of the MIOpen project or as a standalone plugin. ### Building as part of hipDNN -1. Follow the build instructions for hipDNN defined in [Building hipDNN](../../docs/Building.md). +1. Follow the build instructions for hipDNN defined in [Building hipDNN](../../projects/hipdnn/docs/Building.md). 1. Currently the plugin build is defaulted to on. Eventually it won't be a hipdnn build option. ### Building as a standalone plugin In order to build the plugin standalone, you will need to have installed hipDNN and MIOpen on the system first. -1. Navigate to the `plugins/miopen_legacy_plugin` directory. +1. Navigate to the `dnn-providers/miopen-provider` directory. 1. Make a build directory, `mkdir build && cd build`. 1. Run `cmake -DCMAKE_CXX_COMPILER=/clang++ ..` to configure the build. 1. Run `ninja` to build the plugin. diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/cmake/ClangToolChain.cmake b/dnn-providers/miopen-provider/cmake/ClangToolChain.cmake similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/cmake/ClangToolChain.cmake rename to dnn-providers/miopen-provider/cmake/ClangToolChain.cmake diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/cmake/Dependencies.cmake b/dnn-providers/miopen-provider/cmake/Dependencies.cmake similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/cmake/Dependencies.cmake rename to dnn-providers/miopen-provider/cmake/Dependencies.cmake diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/cmake/Tests.cmake b/dnn-providers/miopen-provider/cmake/Tests.cmake similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/cmake/Tests.cmake rename to dnn-providers/miopen-provider/cmake/Tests.cmake diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/cmake/scripts/test_name_validator.py b/dnn-providers/miopen-provider/cmake/scripts/test_name_validator.py similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/cmake/scripts/test_name_validator.py rename to dnn-providers/miopen-provider/cmake/scripts/test_name_validator.py diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/docs/OperationSupport.md b/dnn-providers/miopen-provider/docs/OperationSupport.md similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/docs/OperationSupport.md rename to dnn-providers/miopen-provider/docs/OperationSupport.md diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/EngineInterface.hpp b/dnn-providers/miopen-provider/engines/EngineInterface.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/EngineInterface.hpp rename to dnn-providers/miopen-provider/engines/EngineInterface.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/MiopenEngine.cpp b/dnn-providers/miopen-provider/engines/MiopenEngine.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/MiopenEngine.cpp rename to dnn-providers/miopen-provider/engines/MiopenEngine.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/MiopenEngine.hpp b/dnn-providers/miopen-provider/engines/MiopenEngine.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/MiopenEngine.hpp rename to dnn-providers/miopen-provider/engines/MiopenEngine.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormApplicabilityChecks.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormApplicabilityChecks.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormApplicabilityChecks.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormApplicabilityChecks.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormApplicabilityChecks.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormApplicabilityChecks.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormApplicabilityChecks.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormApplicabilityChecks.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormBwdPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormBwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormBwdPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormBwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormBwdPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormBwdPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormBwdPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormBwdPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdInferencePlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdInferencePlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdInferencePlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdInferencePlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdInferencePlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdInferencePlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdInferencePlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdInferencePlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormFwdTrainingPlanBuilder.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormPlanBuilder.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormPlanBuilder.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormPlanBuilder.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenBatchnormPlanBuilder.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenBatchnormPlanBuilder.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenBatchnormPlanBuilder.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvBwdPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvBwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvBwdPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvBwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvBwdPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvBwdPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvBwdPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvBwdPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlanBuilder.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlanBuilder.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlanBuilder.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlanBuilder.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdBiasActivPlanBuilder.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdBiasActivPlanBuilder.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvFwdPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvFwdPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvFwdPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvPlanBuilder.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvPlanBuilder.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvPlanBuilder.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvPlanBuilder.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvPlanBuilder.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvPlanBuilder.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvWrwPlan.cpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvWrwPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvWrwPlan.cpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvWrwPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvWrwPlan.hpp b/dnn-providers/miopen-provider/engines/plans/MiopenConvWrwPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/MiopenConvWrwPlan.hpp rename to dnn-providers/miopen-provider/engines/plans/MiopenConvWrwPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/PlanBuilderInterface.hpp b/dnn-providers/miopen-provider/engines/plans/PlanBuilderInterface.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/PlanBuilderInterface.hpp rename to dnn-providers/miopen-provider/engines/plans/PlanBuilderInterface.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/PlanInterface.hpp b/dnn-providers/miopen-provider/engines/plans/PlanInterface.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/engines/plans/PlanInterface.hpp rename to dnn-providers/miopen-provider/engines/plans/PlanInterface.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/CMakeLists.txt b/dnn-providers/miopen-provider/integration_tests/CMakeLists.txt similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/CMakeLists.txt rename to dnn-providers/miopen-provider/integration_tests/CMakeLists.txt diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormBackward.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormBackward.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormBackward.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormBackward.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormBackwardActivation.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormBackwardActivation.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormBackwardActivation.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormBackwardActivation.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardInference.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardInference.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardInference.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardInference.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardTraining.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardTraining.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardTraining.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardTraining.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormFwdPlusActive.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormFwdPlusActive.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormFwdPlusActive.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormFwdPlusActive.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormFwdTrainingActiv.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormFwdTrainingActiv.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormFwdTrainingActiv.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormFwdTrainingActiv.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvBackwardData.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvBackwardData.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvBackwardData.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvBackwardData.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvBackwardWeights.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvBackwardWeights.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvBackwardWeights.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvBackwardWeights.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvForward.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvForward.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvForward.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvForward.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvFwdBiasActiv.cpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvFwdBiasActiv.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuConvFwdBiasActiv.cpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGpuConvFwdBiasActiv.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGraphVerificationHarness.hpp b/dnn-providers/miopen-provider/integration_tests/IntegrationGraphVerificationHarness.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/IntegrationGraphVerificationHarness.hpp rename to dnn-providers/miopen-provider/integration_tests/IntegrationGraphVerificationHarness.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/main.cpp b/dnn-providers/miopen-provider/integration_tests/main.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/integration_tests/main.cpp rename to dnn-providers/miopen-provider/integration_tests/main.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/CMakeLists.txt b/dnn-providers/miopen-provider/tests/CMakeLists.txt similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/CMakeLists.txt rename to dnn-providers/miopen-provider/tests/CMakeLists.txt diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenActivationDescriptor.cpp b/dnn-providers/miopen-provider/tests/TestMiopenActivationDescriptor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenActivationDescriptor.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenActivationDescriptor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenConvDescriptor.cpp b/dnn-providers/miopen-provider/tests/TestMiopenConvDescriptor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenConvDescriptor.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenConvDescriptor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenEngineManager.cpp b/dnn-providers/miopen-provider/tests/TestMiopenEngineManager.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenEngineManager.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenEngineManager.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHandleFactory.cpp b/dnn-providers/miopen-provider/tests/TestMiopenHandleFactory.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHandleFactory.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenHandleFactory.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHipdnnEnginePluginHandle.cpp b/dnn-providers/miopen-provider/tests/TestMiopenHipdnnEnginePluginHandle.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHipdnnEnginePluginHandle.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenHipdnnEnginePluginHandle.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHipdnnPluginExecutionContext.cpp b/dnn-providers/miopen-provider/tests/TestMiopenHipdnnPluginExecutionContext.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenHipdnnPluginExecutionContext.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenHipdnnPluginExecutionContext.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenLegacyEnginePluginApi.cpp b/dnn-providers/miopen-provider/tests/TestMiopenLegacyEnginePluginApi.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenLegacyEnginePluginApi.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenLegacyEnginePluginApi.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenLegacyPluginApi.cpp b/dnn-providers/miopen-provider/tests/TestMiopenLegacyPluginApi.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenLegacyPluginApi.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenLegacyPluginApi.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenTensor.cpp b/dnn-providers/miopen-provider/tests/TestMiopenTensor.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenTensor.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenTensor.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenUtils.cpp b/dnn-providers/miopen-provider/tests/TestMiopenUtils.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/TestMiopenUtils.cpp rename to dnn-providers/miopen-provider/tests/TestMiopenUtils.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/ActivationCommon.hpp b/dnn-providers/miopen-provider/tests/common/ActivationCommon.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/ActivationCommon.hpp rename to dnn-providers/miopen-provider/tests/common/ActivationCommon.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/BatchnormCommon.hpp b/dnn-providers/miopen-provider/tests/common/BatchnormCommon.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/BatchnormCommon.hpp rename to dnn-providers/miopen-provider/tests/common/BatchnormCommon.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/ConvolutionCommon.hpp b/dnn-providers/miopen-provider/tests/common/ConvolutionCommon.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/ConvolutionCommon.hpp rename to dnn-providers/miopen-provider/tests/common/ConvolutionCommon.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/GoldenReferenceGpu.hpp b/dnn-providers/miopen-provider/tests/common/GoldenReferenceGpu.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/common/GoldenReferenceGpu.hpp rename to dnn-providers/miopen-provider/tests/common/GoldenReferenceGpu.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/TestMiopenEngine.cpp b/dnn-providers/miopen-provider/tests/engines/TestMiopenEngine.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/TestMiopenEngine.cpp rename to dnn-providers/miopen-provider/tests/engines/TestMiopenEngine.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormApplicabilityChecks.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormApplicabilityChecks.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormApplicabilityChecks.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormApplicabilityChecks.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormBwdPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormBwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormBwdPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormBwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdInferencePlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdInferencePlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdInferencePlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdInferencePlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlanBuilder.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlanBuilder.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingActivPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlanBuilder.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlanBuilder.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormFwdTrainingPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormPlanBuilder.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenBatchnormPlanBuilder.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenBatchnormPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvBwdPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvBwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvBwdPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvBwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdBiasActivPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdBiasActivPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdBiasActivPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdBiasActivPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdBiasActivPlanBuilder.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdBiasActivPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdBiasActivPlanBuilder.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdBiasActivPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvFwdPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvFwdPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvPlanBuilder.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvPlanBuilder.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvPlanBuilder.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvPlanBuilder.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvWrwPlan.cpp b/dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvWrwPlan.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/engines/plans/TestMiopenConvWrwPlan.cpp rename to dnn-providers/miopen-provider/tests/engines/plans/TestMiopenConvWrwPlan.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/main.cpp b/dnn-providers/miopen-provider/tests/main.cpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/main.cpp rename to dnn-providers/miopen-provider/tests/main.cpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockEngine.hpp b/dnn-providers/miopen-provider/tests/mocks/MockEngine.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockEngine.hpp rename to dnn-providers/miopen-provider/tests/mocks/MockEngine.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockHipdnnEnginePluginExecutionContext.hpp b/dnn-providers/miopen-provider/tests/mocks/MockHipdnnEnginePluginExecutionContext.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockHipdnnEnginePluginExecutionContext.hpp rename to dnn-providers/miopen-provider/tests/mocks/MockHipdnnEnginePluginExecutionContext.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockPlan.hpp b/dnn-providers/miopen-provider/tests/mocks/MockPlan.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockPlan.hpp rename to dnn-providers/miopen-provider/tests/mocks/MockPlan.hpp diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockPlanBuilder.hpp b/dnn-providers/miopen-provider/tests/mocks/MockPlanBuilder.hpp similarity index 100% rename from projects/hipdnn/plugins/miopen_legacy_plugin/tests/mocks/MockPlanBuilder.hpp rename to dnn-providers/miopen-provider/tests/mocks/MockPlanBuilder.hpp diff --git a/projects/hipdnn/README.md b/projects/hipdnn/README.md index 40bbb89fbe23..15130167ebd4 100644 --- a/projects/hipdnn/README.md +++ b/projects/hipdnn/README.md @@ -60,7 +60,7 @@ hipDNN is organized into several key components. For detailed architecture descr | **[Frontend](./frontend/)** | Header-only C++ API wrapper around the backend | | **[Data SDK](./data_sdk/)** | Header-only library with data objects, utilities, and logging | | **[Plugin SDK](./plugin_sdk/)** | Header-only library for plugin development | -| **[Plugins](./plugins/)** | Plugin implementations, including [MIOpen Legacy Plugin](./plugins/miopen_legacy_plugin/) | +| **[Plugins](./plugins/)** | Plugin implementations, including [MIOpen Legacy Plugin](../../../dnn-providers/miopen-provider/) | | **[Samples](./samples/)** | Example implementations demonstrating hipDNN usage | | **[Tests](./tests/)** | Tests for the public API (incl. frontend integration tests) | diff --git a/projects/hipdnn/docs/OperationSupport.md b/projects/hipdnn/docs/OperationSupport.md index 4003c1b69a0e..243d904d4063 100644 --- a/projects/hipdnn/docs/OperationSupport.md +++ b/projects/hipdnn/docs/OperationSupport.md @@ -15,7 +15,7 @@ hipDNN operations are implemented through plugins. Each plugin provides its own ### Available Plugins -- **[MIOpen Legacy Plugin](../plugins/miopen_legacy_plugin/docs/OperationSupport.md)** - Integration with AMD's MIOpen library for GPU-accelerated deep learning operations +- **[MIOpen Legacy Plugin](../../../dnn-providers/miopen-provider/docs/OperationSupport.md)** - Integration with AMD's MIOpen library for GPU-accelerated deep learning operations - Convolution operations (Forward, Dgrad, Wgrad) - Batchnorm operations (Training, Backward, Inference) - Fused operation graphs diff --git a/projects/hipdnn/docs/PluginDevelopment.md b/projects/hipdnn/docs/PluginDevelopment.md index 578fb98820ef..f2555f82bfc8 100644 --- a/projects/hipdnn/docs/PluginDevelopment.md +++ b/projects/hipdnn/docs/PluginDevelopment.md @@ -89,7 +89,7 @@ Before creating a plugin, ensure you have **built and installed hipDNN**. Plugin 1. **Create Plugin Structure** - Create a new project/repository for your plugin - Implement the plugin interface defined in [`plugin_sdk/include/hipdnn_plugin_sdk/EnginePluginApi.h`](../plugin_sdk/include/hipdnn_plugin_sdk/EnginePluginApi.h) - - See [MIOpen Legacy Plugin](../plugins/miopen_legacy_plugin/) as a reference implementation (currently included but will become a separate project) + - See [MIOpen Legacy Plugin](../../../dnn-providers/miopen-provider/) as a reference implementation. 2. **Implement Plugin API Functions** @@ -139,9 +139,9 @@ In general, the **best practices** consist of: ### Key Files Reference - **Plugin API Interface**: [`plugin_sdk/include/hipdnn_plugin_sdk/EnginePluginApi.h`](../plugin_sdk/include/hipdnn_plugin_sdk/EnginePluginApi.h) -- **Example Plugin Implementation**: [`plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp`](../plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp) -- **Example Engine Manager**: [`plugins/miopen_legacy_plugin/EngineManager.hpp`](../plugins/miopen_legacy_plugin/EngineManager.hpp) -- **Example Engine Implementation**: [`plugins/miopen_legacy_plugin/engines/MiopenEngine.cpp`](../plugins/miopen_legacy_plugin/engines/MiopenEngine.cpp) +- **Example Plugin Implementation**: [`dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp`](../../../dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp) +- **Example Engine Manager**: [`dnn-providers/miopen-provider/EngineManager.hpp`](../../../dnn-providers/miopen-provider/EngineManager.hpp) +- **Example Engine Implementation**: [`dnn-providers/miopen-provider/engines/MiopenEngine.cpp`](../../../dnn-providers/miopen-provider/engines/MiopenEngine.cpp) ## Plugin Architecture @@ -394,11 +394,11 @@ Integration tests validate end-to-end functionality of your plugin: - **Smoke** - These tests are designed to test features using the smallest possible shape and run quickly (combined smoke test run time must be under 5 mins) - **Full** - These tests can contain regression shapes, large shapes, or slow shapes -For a comprehensive example of an integration test, see: [`plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardInference.cpp`](../plugins/miopen_legacy_plugin/integration_tests/IntegrationGpuBatchnormForwardInference.cpp) +For a comprehensive example of an integration test, see: [`dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardInference.cpp`](../../../dnn-providers/miopen-provider/integration_tests/IntegrationGpuBatchnormForwardInference.cpp) Moreover, see our [general testing requirements](./testing/TestingStrategy.md#general-testing-requirements). -## Example: [MIOpen Legacy Plugin](../plugins/miopen_legacy_plugin/) +## Example: [MIOpen Legacy Plugin](../../../dnn-providers/miopen-provider/) The MIOpen Legacy Plugin is a complete example of a kernel engine plugin. It demonstrates how a plugin integrates with hipDNN and delegates execution to a backend. Furthermore, it incorporates the recommended structure and best practices for kernel engine plugins. @@ -409,6 +409,6 @@ At a high level, it: - Coordinates streams and handles synchronization ### Structure -- **Main Plugin**: [`MiopenLegacyPlugin.cpp`](../plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp) - Entry point and plugin registration -- **Engine Manager**: [`EngineManager.hpp`](../plugins/miopen_legacy_plugin/EngineManager.hpp) - Manages MIOpen engines -- **MIOpen Engine**: [`MiopenEngine.cpp`](../plugins/miopen_legacy_plugin/engines/MiopenEngine.cpp) - Implements graph execution using MIOpen kernels +- **Main Plugin**: [`MiopenLegacyPlugin.cpp`](../../../dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp) - Entry point and plugin registration +- **Engine Manager**: [`EngineManager.hpp`](../../../dnn-providers/miopen-provider/EngineManager.hpp) - Manages MIOpen engines +- **MIOpen Engine**: [`MiopenEngine.cpp`](../../../dnn-providers/miopen-provider/engines/MiopenEngine.cpp) - Implements graph execution using MIOpen kernels diff --git a/projects/hipdnn/docs/rfcs/0002_PluginSdkDesign.md b/projects/hipdnn/docs/rfcs/0002_PluginSdkDesign.md index ab3ba8beefaa..8510cc951c76 100644 --- a/projects/hipdnn/docs/rfcs/0002_PluginSdkDesign.md +++ b/projects/hipdnn/docs/rfcs/0002_PluginSdkDesign.md @@ -43,7 +43,7 @@ The following diagram demonstrates how frontend calls pass through the backend a ![Current System Overview](../images/current_system_overview.png) ### 3.1 Object Lifetimes -For the plugin, there's a comment on `std::weak_ptr` in [MiopenLegacyPlugin.cpp](../../plugins/miopen_legacy_plugin/MiopenLegacyPlugin.cpp) that describes why the weak_ptr / shared_ptr for the container exists. +For the plugin, there's a comment on `std::weak_ptr` in [MiopenLegacyPlugin.cpp](../../../../dnn-providers/miopen-provider/MiopenLegacyPlugin.cpp) that describes why the weak_ptr / shared_ptr for the container exists. To summarize, it's so that if the plugin is opened more than once, the container can be shared, but the container gets cleaned up if that last plugin ref drops off. diff --git a/projects/hipdnn/plugins/miopen_legacy_plugin b/projects/hipdnn/plugins/miopen_legacy_plugin new file mode 120000 index 000000000000..92b6c74d5f58 --- /dev/null +++ b/projects/hipdnn/plugins/miopen_legacy_plugin @@ -0,0 +1 @@ +../../../dnn-providers/miopen-provider \ No newline at end of file