Giter VIP home page Giter VIP logo

Comments (4)

shenweichen avatar shenweichen commented on May 24, 2024 1

@LiChen2012

Hi, I'm sorry that I can't test the GPU version codes because it is a holiday now.
Now I don't know how to put some tensors or ops on CPU when using tf.keras,I think there are 2 methods you can try.

  1. Modify the line 39 ofdeepctr.models.deepfm model like following:
with tf.device("/cpu:0"):
    deep_emb_list, linear_logit, inputs_list = get_inputs_embedding(feature_dim_dict, embedding_size, l2_reg_embedding, l2_reg_linear, init_std, seed)
  1. Reduce embedding_size dimension,for large scale data,usually the embedding_size is small,like [4,8,16,32,64,etc]

from deepctr.

LiChen2012 avatar LiChen2012 commented on May 24, 2024

After modification of code, now GPU memory usage decreased. But it seems still not meet my expectations.
Before the fix, sparse feature embedding memory usage was 3 times of what should be.
After the fix, sparse feature embedding memory usage is double of what should be.
I hope you can take some time to fix it. Thanks.

from deepctr.

LiChen2012 avatar LiChen2012 commented on May 24, 2024

Another issue:
After modification of code, training is slow. GPU usage jumps between 5% to 95%. I suspected that set tensor to CPU will cause memory copy between GPU and CPU.
Thanks.

from deepctr.

shenweichen avatar shenweichen commented on May 24, 2024

This solution puts the vector itself on the CPU, and the parameters created by the optimizer are still on the GPU, so there is still twice the memory usage.
I'm sorry that I don't have a perfect solution right now, and I think I need help from the community~

from deepctr.

Related Issues (20)

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.