Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More advanced activity analysis and many other bugfixes #33

Closed
wants to merge 12 commits into from
Closed

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Nov 13, 2019

Unfortunately digging deeper into the code, I believe a major rewrite to reverse pass loops is necessary for correctness -- this is the extent of the fixes before work on that rewrite began.

Copy link
Contributor

@timkaler timkaler left a comment

Choose a reason for hiding this comment

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

  • you committed output files (e.g "op", etc.) which should be removed.
  • restore the functional_tests_c directory and the makefile target. It doesn't need to be in the CI, but I'd like to continue using it.
  • your changes do not have comments --- if you could make an effort to commenting your code, it would be appreciated.

Cheers,
Tim

Copy link
Contributor

@timkaler timkaler left a comment

Choose a reason for hiding this comment

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

added some inline comments

enzyme/Enzyme/GradientUtils.cpp Show resolved Hide resolved
enzyme/Enzyme/GradientUtils.cpp Show resolved Hide resolved
enzyme/test/Integration/test_utils.h Outdated Show resolved Hide resolved
@@ -48,4 +48,3 @@ message("found llvm version " ${LLVM_VERSION_MAJOR})

add_subdirectory(Enzyme)
add_subdirectory(test)
add_subdirectory(functional_tests_c)
Copy link
Contributor

Choose a reason for hiding this comment

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

keep this subdirectory and the cmake target. CI doesn't need to run it though.

enzyme/Enzyme/EnzymeLogic.cpp Show resolved Hide resolved

assert(lc.latchMerge);
static std::map<std::tuple<GradientUtils*, BasicBlock*, BasicBlock*>, BasicBlock*> mp;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is a gradientutils pointer address being used as part of the key? That is not guaranteed to be unique is it?

@@ -952,7 +959,12 @@ class GradientUtils {
if (size == nullptr) {
size = limits[i];
} else {
size = allocationBuilder.CreateNUWMul(size, limits[i]);
static std::map<std::pair<Value*, BasicBlock*>, Value*> sizeCache;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is using a static map with keys <Value*, BasicBlock*> okay? Are entries deleted from the sizecache in the destructor of gutils?

enzyme/test/Enzyme/op Outdated Show resolved Hide resolved

constexpr size_t IN = 4, OUT = 4, NUM = 5;
__attribute__((noinline))
static double matvec(const Matrix<double, IN, OUT>* __restrict W, const Matrix<double, IN, OUT>* __restrict M) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps add an expect fail test for this where we use MatrixXf

Copy link
Contributor

@timkaler timkaler left a comment

Choose a reason for hiding this comment

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

few more comments on the tests. In general, with the exception of the flag for globals, we should have the same set of commands on all testfiles. If a command fails for certain tests, just have it be expect fail. If we just omit tests then its too easy for us to forget that we have an outstanding bug when compiling with certain settings on certain tests.

@@ -0,0 +1,113 @@
// RUN: %clang -std=c11 -O0 %s -S -emit-llvm -o - | %opt - %loadEnzyme -enzyme -S | %lli -
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this test different from insertsort_sum? It looks like a copy of an older version of that test before extraneous stuff was deleted from the main function)

enzyme/test/Integration/insertsort_sum_alt.c Outdated Show resolved Hide resolved
enzyme/test/Integration/readwriteread.c Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants