-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add RAI checker for installed backends #137
Conversation
Thanks for catching this and taking care of it. My main thought on this is: if it's only used in tests... should it just be in I suppose it might be nice to have this functionality internally. I can think of at least one use case which is to be able to discern wether a user has built any backends at all when initializing an If we do want it internally, it's not necessarily a configuration option as much as it is a helper function. I'm personally leaning towards a helper function. thoughts?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above
@Spartee Yeah, I think we can move it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick fix on unused import and typo-ed variable name that i think is causing tests to error. Otherwise lgtm!!
tests/backends/test_tf.py
Outdated
try: | ||
from tensorflow import keras | ||
|
||
from smartsim.tf import freeze_model | ||
except (ImportError, SmartSimError): | ||
should_run = False | ||
tf_availavble = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tf_available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
smartsim/_core/config/config.py
Outdated
@@ -27,6 +27,7 @@ | |||
import os | |||
from functools import lru_cache | |||
from pathlib import Path | |||
from typing import List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused typing module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
This PR adds data loaders which can be used with TensorFlow and PyTorch to train (or fit) a model. The loaders get the data from the Orchestrator and can be used when training in a distributed fashion (e.g with Horovod). [ committed by @al-rigazzi ] [ reviewed by @Spartee and @MattToast ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Eventually we want to add this to the CLI. maybe a `smart build --check-installed`` command? Either way, glad to have this functionality.
This PR mainly adds
CONFIG.get_installed_backends
, a property returning a list of installed Redis AI backends.This is used e.g. in tests, to check whether the corresponding test should be run. This also helps distinguishing between tests we cannot run because there is no backend, and tests we cannot run because the library is not installed (e.g.
test_freeze_model
which does not need Redis AI).Notice that for backend tests, we also check whether the module is (still) available, to prevent cases in which a user might have built RedisAI in another env.