Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e1a7bc7
allow sym slice attributes
shivadbhavsar Jun 29, 2026
5b33c64
Merge remote-tracking branch 'origin/develop' into sym_slice
shivadbhavsar Jul 8, 2026
bbf66e9
fix tests
shivadbhavsar Jul 8, 2026
88c5a61
Merge branch 'develop' into sym_slice
shivadbhavsar Jul 8, 2026
5e79955
licensing and copilot comments
shivadbhavsar Jul 8, 2026
37a5d6e
Merge branch 'sym_slice' of https://github.com/ROCm/AMDMIGraphX into …
shivadbhavsar Jul 8, 2026
ed88b6a
tidy
shivadbhavsar Jul 8, 2026
d4d32a6
Merge remote-tracking branch 'origin/develop' into sym_slice
shivadbhavsar Jul 16, 2026
786f994
add attribure normalization for symbolic
shivadbhavsar Jul 16, 2026
13dc8fe
Update test/op_shape_test.cpp format
shivadbhavsar Jul 17, 2026
aafa767
inital
CharlieL7 Jul 17, 2026
37b21c0
Update to use bind_symbolic
CharlieL7 Jul 17, 2026
7048749
Add bind_symbolic op and update NMS and slice
CharlieL7 Jul 17, 2026
f6654e1
Comment update
CharlieL7 Jul 20, 2026
860242a
TopK changes
CharlieL7 Jul 21, 2026
8fb0cb7
Merge branch 'develop' of github.com:ROCm/AMDMIGraphX into proto_data…
CharlieL7 Jul 21, 2026
806f28b
Remove bind_symbolic
CharlieL7 Jul 21, 2026
3e4b25e
Slice to use 2+ inputs for all symbolics
CharlieL7 Jul 21, 2026
aa7ce6d
Refine constraints on symbolic slice attributes
CharlieL7 Jul 21, 2026
82f335f
add runtime symbol resolution op
shivadbhavsar Jul 21, 2026
30b3e07
copilot review
shivadbhavsar Jul 21, 2026
f21aa3d
Add bit flag enum and update parse_slice to set slice_mode
CharlieL7 Jul 21, 2026
9db601b
Retain old behavior but add symbolics support
CharlieL7 Jul 22, 2026
7c31007
tidy
shivadbhavsar Jul 22, 2026
0e0afa8
Slice updates and tests
CharlieL7 Jul 22, 2026
9a224a2
Other changes around slice
CharlieL7 Jul 22, 2026
e92d11a
NMS: Early exit ref 0 boxes, add tests for 0 and 1 box edge cases (#4…
mvanhorn Jul 22, 2026
9b410a2
[AIMIGRAPHX-1151] Add pytest bridge for unit tests (#5006)
eddieliao Jul 22, 2026
5c50d0c
Fix nonzero for non-standard input layouts (#5046)
ikalinic Jul 22, 2026
e4736b3
Bump gitpython from 3.1.50 to 3.1.52 in /docs/sphinx (#5091)
dependabot[bot] Jul 23, 2026
82f2328
Update MIGraphX version number to 2.17 (#5080)
causten Jul 23, 2026
8c5dbe2
Add missing hsa-amd-aqlprofile package (#5083)
pfultz2 Jul 23, 2026
6b9fc74
update to simplify IR
shivadbhavsar Jul 23, 2026
a0803a1
ci fix
shivadbhavsar Jul 23, 2026
1416391
format
shivadbhavsar Jul 23, 2026
6e490a9
tidy
shivadbhavsar Jul 23, 2026
f6f858b
fix lowering
shivadbhavsar Jul 23, 2026
4c03db9
Merge branch 'develop' into sym_resolve_op
shivadbhavsar Jul 23, 2026
e4981d3
Generate API sources in the build directory (#4961)
pfultz2 Jul 24, 2026
a73a3aa
symbolic reshape ops (#4977)
shivadbhavsar Jul 24, 2026
ae1b9c3
Update torchkit to support full converter refactor (#5060)
shivadbhavsar Jul 24, 2026
3f80d98
cppcheck
shivadbhavsar Jul 24, 2026
20a1f49
Merge branch 'develop' into sym_resolve_op
shivadbhavsar Jul 24, 2026
c488cd1
Enable hipBLASLt GEMM for gfx115x (#5082)
jomohamm Jul 24, 2026
0c17c0a
Fix bug in reshape_dims when taking a static shape (#5093)
pfultz2 Jul 24, 2026
aff1a33
refactor to update input_shape attr through finalize
shivadbhavsar Jul 24, 2026
3c3908c
Merge branch 'sym_resolve_op' of https://github.com/ROCm/AMDMIGraphX …
shivadbhavsar Jul 24, 2026
49f842b
[AIMIGRAPHX-1209] optimize kernel 2 for non kv cache flash decoding a…
bdevorem Jul 24, 2026
0910e3e
fix merge error
shivadbhavsar Jul 24, 2026
8e44892
Merge branch 'develop' into sym_resolve_op
shivadbhavsar Jul 25, 2026
872fefa
Merge branch 'sym_resolve_op' of github.com:ROCm/AMDMIGraphX into pro…
CharlieL7 Jul 30, 2026
d1c9f3b
Revert "Merge branch 'sym_resolve_op' of github.com:ROCm/AMDMIGraphX …
CharlieL7 Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/include/migraphx/dim_like.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
#ifndef MIGRAPHX_GUARD_MIGRAPHLIB_DIM_LIKE_HPP
#define MIGRAPHX_GUARD_MIGRAPHLIB_DIM_LIKE_HPP

#include <algorithm>
#include <cstdint>
#include <ostream>
#include <type_traits>
#include <vector>

#include <migraphx/config.hpp>
#include <migraphx/picked_variant.hpp>
#include <migraphx/requires.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/sym.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
Expand Down Expand Up @@ -59,6 +62,36 @@ inline std::ostream& operator<<(std::ostream& os, const dim_like& d)
return os;
}

// Extracts the concrete int64_t from each entry; throws (via std::get) if any
// entry holds a symbolic dynamic_dimension.
inline std::vector<int64_t> to_ints(const std::vector<dim_like>& dims)
{
std::vector<int64_t> result(dims.size());
std::transform(dims.begin(), dims.end(), result.begin(), [](const dim_like& d) {
return std::get<int64_t>(d);
});
return result;
}

inline std::vector<sym::expr> to_sym_exprs(const std::vector<dim_like>& dims)
{
std::vector<sym::expr> result(dims.size());
std::transform(dims.begin(), dims.end(), result.begin(), [](const dim_like& d) -> sym::expr {
if(std::holds_alternative<shape::dynamic_dimension>(d))
return std::get<shape::dynamic_dimension>(d).sym_expr;
return sym::lit(std::get<int64_t>(d));
});
return result;
}

// Check if any of the dim_like are a shape::dynamic_dimension.
inline bool any_sym(const std::vector<dim_like>& dims)
{
return std::any_of(dims.begin(), dims.end(), [](const dim_like& d) {
return std::holds_alternative<shape::dynamic_dimension>(d);
});
}

MIGRAPHX_EXPORT void migraphx_to_value(value& v, const dim_like& d);
MIGRAPHX_EXPORT void migraphx_from_value(const value& v, dim_like& d);

Expand Down
110 changes: 110 additions & 0 deletions src/include/migraphx/enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <algorithm>
#include <array>
#include <cstdint>
#include <iterator>
#include <string>
#include <type_traits>
Expand Down Expand Up @@ -141,6 +142,76 @@ struct is_named_enum<T, std::void_t<decltype(migraphx_enum_entries(std::declval<
{
};

// Detects enums declared with MIGRAPHX_BIT_FLAG_ENUM: those provide a migraphx_is_bit_flag hook and
// therefore support the type-safe bitwise operators below.
template <class T, class = void>
struct is_bit_flag : std::false_type
{
};

template <class T>
struct is_bit_flag<T, std::void_t<decltype(migraphx_is_bit_flag(std::declval<T>()))>>
: std::true_type
{
};

// Type-safe bitwise operators for enums declared with MIGRAPHX_BIT_FLAG_ENUM. They operate on the
// enum's underlying integer and return the enum type, so combining values never leaks to a raw
// integer and different flag enums cannot be mixed.
template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E operator|(E lhs, E rhs)
{
using U = std::underlying_type_t<E>;
return static_cast<E>(static_cast<U>(lhs) | static_cast<U>(rhs));
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E operator&(E lhs, E rhs)
{
using U = std::underlying_type_t<E>;
return static_cast<E>(static_cast<U>(lhs) & static_cast<U>(rhs));
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E operator^(E lhs, E rhs)
{
using U = std::underlying_type_t<E>;
return static_cast<E>(static_cast<U>(lhs) ^ static_cast<U>(rhs));
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E operator~(E val)
{
using U = std::underlying_type_t<E>;
return static_cast<E>(~static_cast<U>(val));
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E& operator|=(E& lhs, E rhs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
constexpr E& operator|=(E& lhs, E rhs)
constexpr E& operator|=(E & lhs, E rhs)

{
return lhs = lhs | rhs;
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E& operator&=(E& lhs, E rhs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
constexpr E& operator&=(E& lhs, E rhs)
constexpr E& operator&=(E & lhs, E rhs)

{
return lhs = lhs & rhs;
}

template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr E& operator^=(E& lhs, E rhs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[format.py] reported by reviewdog 🐶

Suggested change
constexpr E& operator^=(E& lhs, E rhs)
constexpr E& operator^=(E & lhs, E rhs)

{
return lhs = lhs ^ rhs;
}

// Returns true when every bit set in flag is also set in val.
template <class E, MIGRAPHX_REQUIRES(is_bit_flag<E>{})>
constexpr bool has_flag(E val, E flag)
{
using U = std::underlying_type_t<E>;
return (static_cast<U>(val) & static_cast<U>(flag)) == static_cast<U>(flag);
}

// Returns the array of enumerator values for an enum declared with MIGRAPHX_ENUM.
template <class Enum, MIGRAPHX_REQUIRES(is_named_enum<Enum>{})>
auto enum_entries()
Expand Down Expand Up @@ -285,4 +356,43 @@ Enum from_string(const std::string& name)
MIGRAPHX_DETAIL_ENUM_HELPERS( \
friend, name, MIGRAPHX_DETAIL_ENUM_CLASS_CAPTURE, using enum_scope = name;, __VA_ARGS__)

// Emits the ADL hook that marks an enum as a bit flag, which is_bit_flag detects to enable the
// bitwise operators. `linkage` is `inline` at namespace scope or `friend` at class scope, mirroring
// MIGRAPHX_DETAIL_ENUM_HELPERS.
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define MIGRAPHX_DETAIL_BIT_FLAG_ENUM(linkage, name) \
linkage constexpr bool migraphx_is_bit_flag(name) { return true; }

// Declares a scoped enum (enum class) with the given underlying type and enables the type-safe
// bitwise operators |, &, ^, ~, |=, &=, ^= and has_flag() on it. Use it at namespace scope:
//
// MIGRAPHX_BIT_FLAG_ENUM(access, std::uint8_t,
// none = 0,
// read = 1 << 0,
// write = 1 << 1)
//
// auto rw = access::read | access::write;
// if(has_flag(rw, access::read)) { /* ... */ }
//
// Unlike MIGRAPHX_ENUM_CLASS, no to_string/from_string helpers are generated, so enumerator values
// should be self-contained bit masks.
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define MIGRAPHX_BIT_FLAG_ENUM(name, type, ...) \
enum class name : type \
{ \
__VA_ARGS__ \
}; \
MIGRAPHX_DETAIL_BIT_FLAG_ENUM(inline, name)

// Like MIGRAPHX_BIT_FLAG_ENUM, but for a scoped enum declared inside a class or struct; the hook is
// generated as a hidden friend so argument-dependent lookup still finds it. Use it inside the
// class/struct body.
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define MIGRAPHX_NESTED_BIT_FLAG_ENUM(name, type, ...) \
enum class name : type \
{ \
__VA_ARGS__ \
}; \
MIGRAPHX_DETAIL_BIT_FLAG_ENUM(friend, name)

#endif // MIGRAPHX_GUARD_MIGRAPHX_ENUM_HPP
Loading