-
Notifications
You must be signed in to change notification settings - Fork 216
[Cpp Graph] Align Cpp Beam Search #322
Conversation
|
reference: MLPerf offline acc test:
MLPerf server acc test:
NEW ADD |
1739376 to
566963e
Compare
|
scores and top_k tokens comparisons between
next_tokens: tensor([[ 198, 198, 317, 475, 383, 38306, 319, 262]])
next_token_scores: tensor([[-1.4747, -2.2295, -4.0196, -4.0743, -4.5361, -4.9157, -4.9327, -5.1006]])
next_indices: tensor([[1, 0, 0, 2, 0, 2, 3, 2]])
beam_scores: tensor([-1.4747, -2.2295, -4.0196, -4.0743])
beam_next_tokens: tensor([198, 198, 317, 475])
beam_idx: tensor([1, 0, 0, 2])
.....
......
=========== final==========
best: [tensor([ 32, 40663, 8604, 319, 262, 8824, 764, 198, 32, 40663,
468, 11406, 319, 262, 8824, 764, 198, 32, 40663, 468,
11406, 319, 262, 8824, 764, 198, 32, 40663, 468, 11406,
319, 262, 8824, 764, 198, 32, 40663, 468, 11406, 319,
262, 8824, 764])]
best_score: tensor([-0.1742])
best_indices: [None]
A spaceship lands on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon .
13: .
764: .
11: ,
1377: --
======================
198:
, score: -1.474517, beam_idx: 1
198:
, score: -2.230055, beam_idx: 0
317: A, score: -4.019489, beam_idx: 0
475: but, score: -4.074911, beam_idx: 2
383: The, score: -4.536015, beam_idx: 0
38306: sparks, score: -4.914916, beam_idx: 2
319: on, score: -4.932207, beam_idx: 3
262: the, score: -5.100197, beam_idx: 2
Current beams:
beams[0]: length: 2, score: -2.230055, eos: 0, tokens:
13: ., 198:
,
beams[1]: length: 2, score: -4.019489, eos: 0, tokens:
13: ., 317: A,
beams[2]: length: 2, score: -1.474517, eos: 0, tokens:
764: ., 198:
,
beams[3]: length: 2, score: -4.074911, eos: 0, tokens:
11: ,, 475: but,
.....
.....
Final beam:
length: 37, score: -0.174138, eos: 0, tokens:
764: ., 198:
, 32: A, 40663: spaceship, 468: has, 11406: landed, 319: on, 262: the, 8824: moon, 764: ., 198:
, 32: A, 40663: spaceship, 468: has, 11406: landed, 319: on, 262: the, 8824: moon, 764: ., 198:
, 32: A, 40663: spaceship, 468: has, 11406: landed, 319: on, 262: the, 8824: moon, 764: ., 198:
, 32: A, 40663: spaceship, 468: has, 11406: landed, 319: on, 262: the, 8824: moon, 764: .,
A spaceship lands on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon .
A spaceship has landed on the moon . |
|
offline test cases for reference (fp32 dtype,
|
dd144c0 to
2abccb6
Compare
|
consider use extension test to keep this beam search feature acc is good |
We should. How about running the |
4704024 to
27184af
Compare
27184af to
1b05472
Compare
fdd061b to
d262675
Compare
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
a32543254
left a comment
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
d262675 to
3f0ebb7
Compare
Type of Change
BUG FIX && Enhancement
Align cpp
beam_searchwith HFtransformersrepo implementationDescription
detail description
JIRA ticket: 835
TODO:
log_softmaxreductions) while keeping the same value astransformerscmake -DBEAM_SEARCH_VERBOSE=ON .., example: log.txt)- [ ] CI (will be added in another pr by usingpybind)Expected Behavior & Potential Risk
numactl -l -C 0-55 ./build/bin/pybind_gptj fp32.bin&& MLPerf offline acc testacc reference:
"ROUGE1", 42.9865 * 0.99, "ROUGE2", 20.1235 * 0.99, "ROUGEL", 29.9881 * 0.99, "GEN_LEN", 4016878*0.9All TESTS TURN OFF
kv_cache_jblasBY SETTINGmemory_type=KV_MEM_TYPE_F16How has this PR been tested?
cpp:numactl -l -C 0-55 ./build/bin/pybind_gptj fp32.binhf:Dependency Change?
None