Git Product home page Git Product logo

Comments (11)

hyunwoongko avatar hyunwoongko commented on May 30, 2024 3

In addition, relative difference can't be expressed as times.
relative difference means the related numerical difference of two numbers.

For example, relative difference of 1 and 2 is 66.7%
is 2kg 66 times heavier than 1kg?
is 2cm 66 times longer than 1cm?
it's not true.

2 is 2 times larger than 1.
66 is 66 times larger than 1.
1 is 66.7% different with 2.
2 is 66.7% different with 1.

why did you express the % as times?

from tf-transformers.

hyunwoongko avatar hyunwoongko commented on May 30, 2024 1

I admire you for developing such a wonderful library. However, skewing the benchmarks is a problem, and it makes users untrustworthy of this library. I recommend that you correct any incorrect expressions in the documentation.

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

Hi @hyunwoongko . Thanks for opening the first issue.
You can find it here .

I tested it on V100 GPU machine.

Code to test: https://github.com/legacyai/tf-transformers/tree/main/benchmarks/gpt2
Website docs : https://legacyai.github.io/tf-transformers/build/html/benchmarks/gpt2.html

Screenshot 2022-04-09 at 11 26 28 AM

Please ignore (tf_text) part .

from tf-transformers.

hyunwoongko avatar hyunwoongko commented on May 30, 2024

Yeah. It's much faster than HF tensorflow implementation.
But 31 minutes is not 90 times faster than 83 minutes. no?
Is there anything I misunderstood?

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

I have calculated relative difference . From 83 minutes to 31 minutes.

Online calculator I used.
https://www.easycalculation.com/algebra/relative-percentage-difference-calculator.php
To be accurate it is 91.228x faster.

But, trust me, in many cases I have even seen 120x times speedup.
But for that other factors comes into picture, variable batch decoding, eos token, sequence length etc.

I have. tutorial ( https://legacyai.github.io/tf-transformers/build/html/tutorials/7_gpt2_question_answering_squad.html ) here, you can experience similar speedup.

from tf-transformers.

hyunwoongko avatar hyunwoongko commented on May 30, 2024

nobody thinks 31 minutes is 90 times faster than 83 minutes. it's 2.67x faster.

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

Agreed . I always calculated relative difference to measure, and apologies for wrong usage of word times as such. I always had this in my mind and updated the docs with new information. From 90 times to 90 % improvement.

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

I admire you for developing such a wonderful library. However, skewing the benchmarks is a problem, and it makes users untrustworthy of this library. I recommend that you correct any incorrect expressions in the documentation.

I don't think, it was supposed to make users untrustworthy or skewed benchmarks. The numbers provided were correct, just that I used times in one part of the README incorrectly. If thats the case, I wouldn't have provided all the scripts and code to reproduce benchmark. But, yes It was mistake from my end for the wrong usage of wordtimes. :)

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

If I am not wrong relative difference is a valid measure to calculate the speedup right. Yes, it can't be expressed as times, my bad. But I believe the benchmarking is very much valid.

from tf-transformers.

aveni avatar aveni commented on May 30, 2024

Just want to second what @hyunwoongko said, the difference from 83min -> 31min should be expressed as either:

  • (31/83) = 0.37 -> decoding takes 37% of the time as it did before
  • or (83/31) = 2.67 -> decoding is performed 2.67x faster than before

The relative difference = |a - b| / mean(a, b) does not make any sense to me as a measure for comparing minutes or throughputs. Unlike the two meaures above, relative difference does not give me a simple way to predict how much faster my own workload would get if I used your library. I would rather not have to solve b = a * (2 - relative_difference) / (2 + relative_difference) in my head.

from tf-transformers.

legacyai avatar legacyai commented on May 30, 2024

@aveni - This is tutorial from huggingface https://huggingface.co/blog/tf-serving .

image

If you see they expressed the speedup in terms of relative difference. I checked internet for how to measure speedup and relative difference seems to be a valid one. But I could be wrong too, I followed it because it was used in the above blog officially and it gives as sense of percentage improvement also.

from tf-transformers.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.