-
Notifications
You must be signed in to change notification settings - Fork 286
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
feat: [VRD-1120, VRD-1130, VRD-1132] Add finetune()
#4085
Conversation
request = conn.make_proto_request( | ||
"GET", "/api/v2/uac-proxy/organization" | ||
request = conn.make_proto_request("GET", "/api/v2/uac-proxy/organization") | ||
response = conn.must_proto_response( | ||
request, OrganizationV2_pb2.ListOrganizationsV2.Response | ||
) | ||
response = conn.must_proto_response(request, OrganizationV2_pb2.ListOrganizationsV2.Response) |
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.
Ignore; black
did this.
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.
I mean this was bad
raise ValueError("cannot provide both `organization_id` and `organization_name`") | ||
raise ValueError( | ||
"cannot provide both `organization_id` and `organization_name`" | ||
) |
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.
Ignore; black
did this.
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.
rude
@staticmethod | ||
def _get_or_create_project( |
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.
This whole file's changes are basically factoring out static versions of these get_or_create
methods so that they can be called without needing to instantiate a new Client
. See the absolute nightmare that is Client.__init__()
—this company's oldest extant Python function—for why we want to avoid that.
Ideally these would actually be moved to new classes—which I have vague, vague plans for—but I wanted to keep this diff as readable as possible for now.
def create_external_build(self, location: str, requires_root: Optional[bool] = None, scan_external: Optional[bool] = None, self_contained: Optional[bool] = None) -> Build: | ||
def create_external_build( | ||
self, | ||
location: str, | ||
requires_root: Optional[bool] = None, | ||
scan_external: Optional[bool] = None, | ||
self_contained: Optional[bool] = None, | ||
) -> Build: |
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.
Ignore; black
did this.
return Build._create_external(self._conn, self.workspace, self.id, location, requires_root, scan_external, self_contained) | ||
return Build._create_external( | ||
self._conn, | ||
self.workspace, | ||
self.id, | ||
location, | ||
requires_root, | ||
scan_external, | ||
self_contained, | ||
) |
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.
Ignore; black
did this.
Common Code Coverage
|
Backend Code Coverage
|
5a40e49
to
c48f9ef
Compare
if id is None and self._ctx.proj is None: | ||
self.set_project() |
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.
This is moved here from the old lines 634–635 below, because the static method can't access self.set_project()
finetune()
finetune()
finetune()
finetune()
:class:`~verta.registry.entities.RegisteredModelVersion` | ||
New fine-tuned model version. | ||
|
||
""" |
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.
], | ||
train_dataset: _dataset_version.DatasetVersion, | ||
eval_dataset: Optional[_dataset_version.DatasetVersion] = None, | ||
test_dataset: Optional[_dataset_version.DatasetVersion] = None, |
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.
Not actually sure whether we want/need test_dataset
. I included it because it felt reasonable for calculating end-of-training performance, but eval_dataset
might just serve the same purpose.
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.
I say leave it 🤷🏼♀️
# TODO: [VRD-1131] check `enable_mdb_versioning` | ||
|
||
ctx = _Context(self._conn, self._conf) | ||
ctx.workspace_name = self.workspace |
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.
Do you know if we'll also need to handle orgs here?
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.
Oh shoot
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.
I've verified that Grpc-Metadata-organization-id
is faithfully sent on every request. It's encapsulated in conn
.
Impact and Context
Creates the ER for tracking the fine-tuning job, creates the RMV for storing the fine-tuned model, logs datasets and internal attributes, and
POST
s/finetuning-job
.Risks and Area of Effect
There's a very touchy refactor of a handful of
Client
methods, but I covered them in Testing.Testing
Ran the new
test_finetune
integration test, along with coverage of entity CRUD methods on the client to check for regressions on the refactorThe one failure on
registry/test_model.py::TestModel::test_find
is unrelated.Reverting
Revert this PR.