deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Segmentation fault when deleting a GPU net #200

Closed simleo closed 3 years ago

simleo commented 3 years ago

As of EDDL 0.7.0, deleting a net built with a CS_GPU causes a segmentation fault:

#include <eddl/apis/eddl.h>

using namespace eddl;

int main(int argc, char **argv) {
    layer in = Input({784});
    layer l = in;
    l = Activation(Dense(l, 256), "relu");
    layer out = Dense(l, 784);
    model net = Model({in}, {out});
    build(net,
          sgd(0.001, 0.9),
          {"mean_squared_error"},
          {"mean_squared_error"},
          CS_GPU({1})
    );
    delete net;
}

The impact on the Python bindings is to break any program that tries to use the GPU, since all objects are automatically deleted by the interpreter at shutdown. This problem was not present in EDDL 0.6.0.

Note that the segmentation fault does not happen if a CS_CPU is used instead.

RParedesPalacios commented 3 years ago

Hi, yes we are on the way to check these deletes.

RParedesPalacios commented 3 years ago

Please check new master. If everything works it will be 0.7.1

simleo commented 3 years ago

Please check new master. If everything works it will be 0.7.1

With pyeddl at this revision (in my fork), on top of EDDL rev. 4f6d6de6, all current Python tests and examples run fine. Please go ahead with tag 0.7.1.

simleo commented 3 years ago

Also looks OK with the latest master