This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add a trained DecisionForest for code completion.
ClosedPublic

Authored by usaxena95 on Sep 21 2020, 11:12 PM.

Details

Summary

Replaces the dummy CodeCompletion model with a trained DecisionForest
model.

The features.json are manually curated specifying the features
to be used. This is a one-time cost and does not change if the model
changes until we decide to add/remove features.

Stats for comparison:


Binary size
ClangdTests binary: -> 263.1624MB -> 263.65324MB (*0.2%* increase)


Build Time
ninja ClangdTests:
Only changing the completion model and rebuilding using cache: 32.24s -> 38.75s
Clean build: 05:27 min-> 5:30 min

Minor (3-6s) increase in build time.


Latency
For float Evaluate(const Example&): 3-4 us.
A completion query having ~1000 completion candidates will take about 3-4ms to get ranked.

Diff Detail

Event Timeline

usaxena95 created this revision.Sep 21 2020, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2020, 11:12 PM
usaxena95 requested review of this revision.Sep 21 2020, 11:12 PM
usaxena95 edited the summary of this revision. (Show Details)Sep 22 2020, 8:59 AM
usaxena95 added a reviewer: adamcz.
adamcz accepted this revision.Sep 23 2020, 3:36 AM
This revision is now accepted and ready to land.Sep 23 2020, 3:36 AM