Comments (7)
It's a model parameter, so it will be updated by optimizer.step() like any other parameter.
from adaptive-span.
Thanks for your reply. I wanted to ask:
- Do you think adaptive span takes a longer time to converge as compared to standard attention ? In my case, I'm seeing improvements but the extent is very less. Could this be due to
trim_memory
? Did you try this on other tasks except char LM ? - In your experiments, did adaptive span loss become non zero at any moment ? Although
current_val
is a parameter and it's being constantly updated, the loss is a constant 0.
Thanks for your support.
from adaptive-span.
-
Not sure what "converge" means here. If you're saying it's not growing large enough, you might want to reduce the loss coefficient associated with it. trim_memory shouldn't affect learning. Yes, we used it on word level LM without a problem.
-
The loss can be zero if it has too large weight compared to the LM loss. Try setting
--adapt-span-loss
to 0.
from adaptive-span.
Hi,
Thanks for replying. What did you use to calculate FLOPS?
from adaptive-span.
We just counted all the flops in the model. For example, a linear layer has d_in x d_out
flops.
from adaptive-span.
Thanks for your reply.
- In case where
trim_len<0
, thetrim_memory
will perform padding on the input tensor as specified here. So in my case,trim_len<0
since 1024 is big, here's what happens:
# query.shape -> [128,36,768]
# key.shape -> [128,20,768]
# value.shape -> [128,20,768]
k,v,k_pe = adaptive.trim_memory(q,k,v,k_pe)
# k.shape -> [128,1060,768]
# v.shape -> [128,1060,768]
# k_pe.shape -> [1,64,768]
So in this case, I don't think memory consumption is being reduced, since now the dimensions have risen many fold, and more FLOPS are required. Am I right or am I missing something? So for now, I've removed this operation.
- Using masking function as specified in the paper, my FLOPS have stayed the same
macs: 12.074G
params: 237.558M
These results are noted during inference. Did you measure FLOPS (as per in the paper) during training (since spans only change during this process only) ? My spans are changing after some changes, but the FLOPS are same. Is it because trimming operations are solely responsible for reducing FLOPS ?
from adaptive-span.
As noted in the paper, FLOPS
is the number of FLOPS necessary for computing one step prediction. So it's not the training time flops where a batch of samples being processed together.
from adaptive-span.
Related Issues (20)
- Will adaptive-span have faster predictive speeds than gpt-2? HOT 2
- Compute attention span of individual attention heads HOT 1
- Queries about adaptive span HOT 1
- Warning with PyTorch 1.4 HOT 4
- A question about parameter z_t HOT 9
- Generate text HOT 1
- BPC HOT 6
- Understanding graphs from papers
- What does batch-size mean using distributed trainning? HOT 1
- Please convert to a permissive license
- confuse HOT 1
- Accept a mask to remove padding in batch HOT 1
- what is the cache_size mean? HOT 1
- Why does the hyper-parameter --batch-sz affect the bpc during evaluation? HOT 3
- Where to find the pretrained checkpoint? HOT 1
- Using mask can reduce FLOPs? HOT 2
- Question: How to reduce the memory in this project HOT 7
- did you try to start with maximum possibile cache size HOT 2
- why not compare other local attention methods? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adaptive-span.