[core] Cleanup metrics stuff + fix gcc >10 build#56514
[core] Cleanup metrics stuff + fix gcc >10 build#56514edoakes merged 7 commits intoray-project:masterfrom
Conversation
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
|
@can-anyscale PTAL |
can-anyscale
left a comment
There was a problem hiding this comment.
lgtm; just a question on the c++ apis
cpp/include/ray/api/metric.h
Outdated
| /// \param[in] value The value that we record. | ||
| /// \param[in] tags The map tag values that we want to record | ||
| void Observe(double value, const std::unordered_map<std::string, std::string> &Tags); | ||
| void Observe(double value, |
There was a problem hiding this comment.
oh i actually wasn't aware of these APIs; are they our internal API or user facing APIs? If the later can we actually change the signatures?
There was a problem hiding this comment.
Ya I was wondering this too, it looks user facing @jjyao on if we can change?
There was a problem hiding this comment.
I think these are technically public APIs
There was a problem hiding this comment.
kk, I guess we can remove the changes of cpp/include in this PR, or communicate the deprecation plan publicly etc. then it is good to merge
There was a problem hiding this comment.
updated to just revert the cpp api back, just turning into a string vector at the end before calling into core. We're killing a copy on the core side so even though we're adding a cheaper copy (bc string_views), it's still an improvement.
There was a problem hiding this comment.
sg that's what I would've suggested
| const std::vector<std::string> &tag_keys = {}); | ||
|
|
||
| virtual ~Metric(); | ||
| ~Metric() override; |
There was a problem hiding this comment.
qq, that is the effect of this change?
There was a problem hiding this comment.
No functional change but only the base class needs the destructor to be virtual and the base class is MetricInterface now, everything else is overriding
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
This reverts commit 2330b62.
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Zhiqiang Ma <zhiqiang.ma@intel.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: zac <zac@anyscale.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Marco Stephan <marco@magic.dev>
Signed-off-by: dayshah <dhyey2019@gmail.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after #56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after #56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
…6915) https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after ray-project#56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Josh Kodi <joshkodi@gmail.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com>
…6915) https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after ray-project#56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com>
…6915) https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after ray-project#56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com>
…6915) https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after ray-project#56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
## Why are these changes needed? Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough. Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them. There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency. The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient. Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves. --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
…6915) https://buildkite.com/ray-project/postmerge-macos/builds/8257#01997de0-1e13-4954-a370-6255f650ca17 mac c++ / java tests broke after ray-project#56514. Fixing by reverting to have tag_defs.cc define the vars in a separate file and not just in the header. Why does this fix it - I have no idea... for some reason the c++ api dynamic linking madness doesn't like the inlined vars on the mac build specifically??? --------- Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
Why are these changes needed?
Fixing the build for my gcc devbox, was struggling to disambiguate between map with string_view vs. map with string. Changed Record to always take string_view. The string overload is only used in Cython so just have a separate RecordForCython that's not part of the MetricInterface. We can't use string_view in Cython because our Cython version isn't new enough.
Also killing tag_defs.cc, it just had one line tag registrations that could go in the headers. There were some tags that were unused so killed them.
There were also some string constants that could just be put in the one spot they were used so the files that use it don't need the dependency.
The biggest change is changing the record to take a vector of pairs instead of an unordered map. We didn't use the map aspect of it, so a vector is more efficient.
Record was also taking by const ref before and then trying to move, so the move wasn't actually happening. Taking by value now so that it actually moves.