Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
W
word2vec
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • DESHPANDE SRIJAY PARAG
  • word2vec
  • Issues
  • #36

Closed
Open
Opened Mar 21, 2016 by DESHPANDE SRIJAY PARAG@srijayd
  • Report abuse
  • New issue
Report abuse New issue

word2vec.c: Minor tweak to reduce CPU pipeline stalls (3% gain)

Created by: GoogleCodeExporter

The perf utility reported a bottleneck in this area, where it's waiting for the 
'target' variable to be finalized. By computing the next value of target early, 
overall performance is increased by about 3% on a small (128MB) training file.

add next_target next to target in the variable list.

Then in the two negative sampling blocks:
...
          if (d == 0) {
            target = word;
            label = 1;
            next_random = next_random * (unsigned long long)25214903917 + 11;
            next_target = table[(next_random >> 16) % table_size];
          } else {
            target = next_target;
            if (target == 0) target = next_random % (vocab_size - 1) + 1;
            next_random = next_random * (unsigned long long)25214903917 + 11;
            next_target = table[(next_random >> 16) % table_size];
            if (target == word) continue;
            label = 0;
          }
...

Original issue reported on code.google.com by chad.p...@gmail.com on 22 Jul 2015 at 6:40

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: srijayd/word2vec#36