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

Integrate the wikitext task in the webapp #675

Merged
merged 21 commits into from
Jun 17, 2024
Merged

Conversation

JulienVig
Copy link
Collaborator

@JulienVig JulienVig commented May 15, 2024

Screenshot 2024-06-11 at 17 23 36

  • Rework the validator's test and inference method to enable users to stop and also fix tfjs memory leaks
    Screenshot 2024-06-13 at 16 35 53

@JulienVig JulienVig added bug Something isn't working web client Related to the browser environment discojs Related to Disco.js labels May 15, 2024
@JulienVig JulienVig self-assigned this May 15, 2024
@JulienVig JulienVig marked this pull request as ready for review June 11, 2024 16:17
@JulienVig JulienVig requested a review from tharvik June 11, 2024 16:17
Copy link
Collaborator

@tharvik tharvik left a comment

Choose a reason for hiding this comment

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

wouhou, gpt in browser, well done!

testing the model is a bit weird, as there is not specific handler for that (got 5000% accuracy, such impressive model). but that's alright for now IMO, we can add it in a later iteration

discojs-web/src/memory/memory.ts Outdated Show resolved Hide resolved
discojs-web/src/memory/memory.ts Outdated Show resolved Hide resolved
discojs-web/src/memory/memory.ts Outdated Show resolved Hide resolved
discojs/src/memory/model_type.ts Outdated Show resolved Hide resolved
discojs/src/models/gpt/index.ts Outdated Show resolved Hide resolved
discojs/src/models/tokenizer.ts Show resolved Hide resolved
discojs/src/task/training_information.ts Show resolved Hide resolved
webapp/src/store/memory.ts Outdated Show resolved Hide resolved
webapp/src/store/memory.ts Outdated Show resolved Hide resolved
webapp/src/store/memory.ts Outdated Show resolved Hide resolved
@JulienVig
Copy link
Collaborator Author

Did you really get 5000% accuracy? If that's the case this is alarming, I don't see how it could happen

@tharvik
Copy link
Collaborator

tharvik commented Jun 13, 2024

Did you really get 5000% accuracy? If that's the case this is alarming, I don't see how it could happen

yep, it's fluctuating around 5000%±1000%, and use a huge amount of memory (before crashing my tab). the reproductability that I've is training wikitext once with "wiki.train.tokens" then testing it with "wiki.test.tokens". I'm using Firefox fwiw. before crashing it shows the next line in console:
High memory usage in GPU: 1199.58 MB, most likely due to a memory leak
and indeed, my system memory gets filled up quite rapidly (which triggers OOM, which kills the tab)

@JulienVig
Copy link
Collaborator Author

Indeed I'll try to fix that before merging the PR, testing the model takes up more than 50GB

@JulienVig
Copy link
Collaborator Author

JulienVig commented Jun 13, 2024

@tharvik all fixed, I reworked the validator:

  • removed the graph_informant (it was only used to query the validator accuracy)
  • fixed the memory leak (tfjs sucks)
  • fixed the logic mistake that yielded 5000 of accuracy
  • renamed assess and predict into test and inference respectively
  • made these methods generators to let users stop them. I had to turn the mapAsync into an iterator while loop to allow stopping, do you know if we could combine the functional way and generators somehow?

Until an LLM UI is implemented running inference is useless as it doesn't display anything

@tharvik
Copy link
Collaborator

tharvik commented Jun 14, 2024

@tharvik all fixed, I reworked the validator:

superbe, it tests nicely now 🥳 (tfjs is shitty indeed)
and good idea to update the validator to be a real generator, that's more in line w/ training and more usuable.

  • made these methods generators to let users stop them. I had to turn the mapAsync into an iterator while loop to allow stopping, do you know if we could combine the functional way and generators somehow?

hum, no, you sadly have to have a while loop as tf.data.Dataset is not using generators. however, as datasets are lazy, you can have a dataset shaped with mapAsync and have a small while loop taking care of transforming it in a generator (maybe a bit more readable).
generators a quite powerful, but if libraries aren't exposing theses, it doesn't know how to stop processing a function. it can only return between lines, and in this case, there is a huge await dataset.mapAsync.[...].toArray so it can only stop before or after that.

Until an LLM UI is implemented running inference is useless as it doesn't display anything

yep, I'm trying to draft up something basic in my PR, let's see what comes out of it :)

@JulienVig JulienVig merged commit 111981d into develop Jun 17, 2024
23 checks passed
@JulienVig JulienVig deleted the 669-wikitext-web-julien branch June 17, 2024 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discojs Related to Disco.js web client Related to the browser environment
Projects
None yet
2 participants