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

Can't determine whether an API call is from TensorFlow when more than two functions are in a call chain #49

Closed
tatianacv opened this issue Jun 20, 2023 · 4 comments · Fixed by #64

Comments

@tatianacv
Copy link
Contributor

tatianacv commented Jun 20, 2023

When processing the following:

import tensorflow as tf

def func2(t):
  pass

@tf.function
def func():
  a = tf.constant([[1.0, 2.0], [3.0, 4.0]])
  b = tf.constant([[1.0, 1.0], [0.0, 1.0]])
  c = tf.matmul(a, b)
  tensor = tf.Tensor(c.op, 0, tf.float32)
  func2(tensor)

func()

We found an error in determining whether we are dealing with a TensorFlow API. We found that the tensor analysis is empty:

TensorTypeAnalysis analysis = E.performAnalysis(builder);

@khatchad
Copy link
Collaborator

@tatianacv Can you open a PR with the failing test?

@khatchad khatchad reopened this Jun 21, 2023
@khatchad
Copy link
Collaborator

khatchad commented Jun 21, 2023

@tatianacv Can you please add a PR like this one to https://github.com/wala/ML/pulls?

@khatchad
Copy link
Collaborator

@tatianacv Can you please add a PR like this one to https://github.com/wala/ML/pulls?

Sorry, I know I asked for this, but I think we can use ponder-lab#26 for now.

@khatchad khatchad changed the title Problem with finding out whether it is a TensorFlow API Can't determine whether an API call is from TensorFlow when more than two functions are in a call chain Jun 22, 2023
@khatchad khatchad linked a pull request Jun 26, 2023 that will close this issue
khatchad added a commit that referenced this issue Jun 27, 2023
All "level 1" APIs and one "level 2" API (`random.uniform`) are now inferred via summaries.

This PR addresses the following issues:

1. #60
2. #49

---------

Co-authored-by: Raffi Khatchadourian <raffi.khatchadourian@hunter.cuny.edu>
@khatchad
Copy link
Collaborator

khatchad commented Jun 27, 2023

The passing test case for this issue is here:

Input file:

import tensorflow as tf
def func2(t):
pass
@tf.function
def func():
a = tf.constant([[1.0, 2.0], [3.0, 4.0]])
b = tf.constant([[1.0, 1.0], [0.0, 1.0]])
c = tf.matmul(a, b)
tensor = tf.Tensor(c.op, 0, tf.float32)
func2(tensor)
func()

khatchad added a commit that referenced this issue Jul 3, 2023
* Replace commented out output with "fine" logging.

* Use "fine" logging in Maven build.

* Split logging properties for CI.

Less logging on the CI. CI is complaining about too much logging.

* Centralize log config.

So that it applies to all tests.

* Fix CI.

* Define a custom logging config file property.
khatchad added a commit that referenced this issue Jul 5, 2023
* Replace commented out output with "fine" logging.

* Use "fine" logging in Maven build.

* Split logging properties for CI.

Less logging on the CI. CI is complaining about too much logging.

* Centralize log config.

So that it applies to all tests.

* Fix CI.

* Define a custom logging config file property.

Co-authored-by: Manu Sridharan <msridhar@gmail.com>
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 a pull request may close this issue.

2 participants