--- Log opened Tue Jun 04 00:00:44 2019 | ||
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has joined #shogun | 07:58 | |
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has quit [Ping timeout: 256 seconds] | 09:12 | |
-!- wiking_ [~wiking@huwico/staff/wiking] has joined #shogun | 09:15 | |
-!- mode/#shogun [+o wiking_] by ChanServ | 09:15 | |
-!- wiking_ [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer] | 09:18 | |
-!- gf712 [90520862@gateway/web/freenode/ip.144.82.8.98] has joined #shogun | 10:02 | |
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has joined #shogun | 11:50 | |
gf712 | essam: hey, how did your exams go? | 11:52 |
---|---|---|
essam | smoothly | 11:54 |
essam | glad they're over though :"D | 11:55 |
gf712 | good! are you done with this academic year then? | 11:56 |
essam | yes | 11:56 |
-!- abhinandan [67629c5b@gateway/web/freenode/ip.103.98.156.91] has joined #shogun | 12:57 | |
-!- abhinandan [67629c5b@gateway/web/freenode/ip.103.98.156.91] has quit [Client Quit] | 12:58 | |
essam | gf712: I have a question. how to properly pass a part of an SGVector [l, h[ as an SGVector? | 14:51 |
gf712 | essam: i am not sure I understand what you mean? you mean to slice a range? | 14:55 |
essam | yes | 14:57 |
gf712 | I don't think there is a way without making a copy | 14:57 |
gf712 | you could construct a new sgvector with the same underlying pointer and start from where you want until a given size | 15:00 |
gf712 | but then you have to be careful you don't leave end up with a dangling reference | 15:00 |
gf712 | essam: do you need a reference or a copy? | 15:01 |
essam | a reference of the data, but a copy of the SGVector | 15:02 |
essam | I don't want to change the original SGVector | 15:02 |
essam | if reference counting is enabled, can a dangling reference occur? | 15:02 |
gf712 | depends if the lifetime of the original is longer than the sliced version | 15:03 |
essam | right, so if the original is shorter, a memory leak would happen | 15:03 |
gf712 | if it is shorted you have UB right? | 15:03 |
gf712 | because the destructor of the original will be called | 15:03 |
gf712 | and deallocate the pointer | 15:04 |
essam | if reference counting is disabled in the slice | 15:04 |
gf712 | unless they share a refcounter | 15:04 |
gf712 | yup | 15:04 |
essam | i think if we want to get rid of raw pointers, we should have a mechanism for slicing | 15:04 |
gf712 | so for the slicing you would need a vector that shares the refcount with the original vector right? | 15:06 |
essam | dense_dot is used at multiple places where a slice of a vector is used instead of the whole one | 15:06 |
gf712 | I am not sure if that is already possible | 15:06 |
gf712 | just having a look now | 15:06 |
essam | but the slice should know about the whole vector i guess, so as to deallocate it correctly | 15:06 |
essam | its original length and beginning | 15:07 |
gf712 | yes I agree | 15:07 |
gf712 | hmm or maybe it's own class? | 15:07 |
gf712 | I think that's what armadillo does | 15:07 |
gf712 | there are these slice objects | 15:08 |
gf712 | and I would assume they are aware of the original data | 15:08 |
essam | armadillo? | 15:08 |
gf712 | so that deallocation happens properly if the slice is the last reference | 15:08 |
gf712 | essam: http://arma.sourceforge.net | 15:09 |
gf712 | very cool project | 15:09 |
essam | nice, I will take a look | 15:09 |
gf712 | does some linalg stuff and has containers for vectors, matrices and "cubes" | 15:10 |
gf712 | yea, might be worth having a look to see how slices are implemented there | 15:10 |
gf712 | because copying would be very innefficient | 15:10 |
essam | cubes = 3d matrices? | 15:10 |
gf712 | and using references can be buggy | 15:10 |
gf712 | yes | 15:10 |
essam | ok thanks, I will check them out | 15:12 |
gf712 | essam: the slicing is done by arma::span, see http://arma.sourceforge.net/docs.html#submat | 15:13 |
essam | slicing returns an instance of the same class | 15:14 |
essam | which is mat there | 15:15 |
essam | cool semantics. very python like | 15:16 |
gf712 | is it a copy? | 15:17 |
essam | not sure yet | 15:20 |
essam | also not sure about slicing. I didnt take operator overloading in consideration | 15:21 |
gf712 | yea, I don't think there would be an operator you could use, it's not like python where you can use [:N] | 15:24 |
gf712 | essam: so the subview classes hold references to the original data | 15:27 |
gf712 | and I guess the refcount is incremented that way | 15:28 |
gf712 | anyway, might be a whole project to get something like that working well | 15:28 |
essam | shouldn't it be easy with SGVectors? they are not as general as tensors | 15:30 |
gf712 | hmm I guess, you could just have .slice(start, end) | 15:32 |
gf712 | end then create a new SGVector | 15:33 |
gf712 | but then you have to copy the refcounter | 15:33 |
essam | the refcounter is only a pointer right? | 15:33 |
gf712 | yup | 15:34 |
gf712 | it's private though I think | 15:34 |
gf712 | in shogun/lib/SGReferencedData.h | 15:34 |
gf712 | you can copy_refcount | 15:34 |
gf712 | I think that would work? | 15:34 |
gf712 | so inside slice have new_vec.copy_refcount(m_refcount) | 15:35 |
gf712 | and then increment the count once | 15:35 |
gf712 | with ref() | 15:35 |
gf712 | and the vector member would be just vec+start | 15:36 |
essam | right, and have something like original_vlen | 15:36 |
gf712 | and Len would be end-start | 15:36 |
gf712 | that should be it no? | 15:36 |
gf712 | ah right yes | 15:36 |
gf712 | you still need to keep track of the original pointer | 15:37 |
essam | yes, for deallocation | 15:37 |
essam | so maybe something like orig_vlen and offset | 15:37 |
gf712 | yes exactly | 15:37 |
gf712 | I am not sure what the impact on performance will be | 15:38 |
gf712 | because then you need to check offset each time? | 15:38 |
essam | no I wont check offset at all, I guess | 15:39 |
essam | only when slicing | 15:39 |
essam | new_vector = vector + offset | 15:39 |
essam | when I deallocate, I will subtract it | 15:39 |
gf712 | ok, but what happens when you have: | 15:40 |
gf712 | auto new_vec = vec.slice(5,10) | 15:40 |
gf712 | new_vec.slice(0,2) | 15:40 |
gf712 | the 0 index is the offset right? | 15:40 |
gf712 | and if it's the same class, i.e. sgvector, you need to track it constantly | 15:41 |
essam | I guess the offset should be accumulated then | 15:41 |
gf712 | ok, so just substract in destructor I guess won't be too bad | 15:41 |
gf712 | yea, seems fine with me actually | 15:42 |
essam | cool | 15:42 |
gf712 | and how does it work when you want to use Eigen? | 15:42 |
gf712 | I guess that would be fine | 15:43 |
essam | I guess the same | 15:43 |
gf712 | yup | 15:43 |
gf712 | I guess give it a try and run tests | 15:43 |
gf712 | see what happens | 15:43 |
gf712 | in theory it might work :D | 15:43 |
essam | yea :"D | 15:43 |
gf712 | btw have you looked also at the GPU stuff? | 15:46 |
essam | no not yet | 16:03 |
essam | i believe many of the linalg functions aren't implemented in the GPUBackend | 16:04 |
essam | do things work with gpu backend? | 16:06 |
gf712 | I am not sure as it isn't tested by the ci | 16:16 |
gf712 | I know that it used to be tested by Buildbot | 16:16 |
gf712 | but that is down right now | 16:16 |
gf712 | but we shouldn't break the GPU stuff more | 16:17 |
gf712 | essam: in any case start a PR and Viktor and heiko can see if it would break GPU stuff | 16:18 |
essam | gf712: ok | 16:29 |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 17:16 | |
-!- mode/#shogun [+o wiking] by ChanServ | 17:16 | |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer] | 17:27 | |
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has quit [Ping timeout: 256 seconds] | 17:34 | |
-!- HeikoS [~heiko@131.pool85-48-187.static.orange.es] has joined #shogun | 17:46 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17:46 | |
lisitsyn | HeikoS: hey! | 17:47 |
@HeikoS | lisitsyn: ho | 17:47 |
lisitsyn | wie gehts? | 17:47 |
@HeikoS | gut :) | 17:47 |
lisitsyn | HeikoS: ^ preparing! | 17:47 |
@HeikoS | and you? | 17:47 |
@HeikoS | haha | 17:47 |
lisitsyn | ich bin guuut! | 17:47 |
lisitsyn | :D | 17:47 |
lisitsyn | do you get there on thursday? | 17:48 |
@HeikoS | i think yes | 17:48 |
@HeikoS | 6th | 17:48 |
@HeikoS | late in the evening | 17:48 |
@HeikoS | and you again? | 17:49 |
lisitsyn | HeikoS: friday evening | 17:50 |
@HeikoS | alright | 17:50 |
@HeikoS | we have a dinner confirmed on sat :) | 17:50 |
lisitsyn | HeikoS: korean? :) | 17:51 |
lisitsyn | HeikoS: what do we do on friday? | 17:51 |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 17:51 | |
-!- mode/#shogun [+o wiking] by ChanServ | 17:51 | |
@HeikoS | so the venue is 9-5 | 17:51 |
@HeikoS | so all over by the time you arrive on Friday | 17:52 |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer] | 17:52 | |
@HeikoS | need to think of something nice | 17:52 |
@HeikoS | lisitsyn: cbase is an idea | 18:02 |
@HeikoS | we can hack / have a drink there on Friday eve | 18:02 |
lisitsyn | ohh cbase is so bad :D | 18:02 |
lisitsyn | but yeah why not | 18:02 |
-!- gf712 [90520862@gateway/web/freenode/ip.144.82.8.98] has quit [Ping timeout: 256 seconds] | 18:13 | |
@HeikoS | hehe | 18:18 |
@HeikoS | we can also go somewhere else | 18:18 |
@HeikoS | bad memories form the place lisitsyn? :D | 18:18 |
lisitsyn | HeikoS: it is dark and noisy | 18:19 |
@HeikoS | it is | 18:19 |
@HeikoS | but you can pull out a computer as a large group there on a Friday night | 18:19 |
@HeikoS | few other places would like that in B | 18:19 |
lisitsyn | HeikoS: what about putting out our computers and be humans :D | 18:20 |
@HeikoS | hehe | 18:20 |
@HeikoS | also good | 18:20 |
@HeikoS | later definitely | 18:20 |
@HeikoS | I guess I was talking about the time from 5-7 say | 18:20 |
@HeikoS | you know | 18:20 |
@HeikoS | tomtom kicks us out at 5 | 18:20 |
@HeikoS | or rather sonney2k does | 18:20 |
@HeikoS | but I will ask him for ideas | 18:20 |
lisitsyn | HeikoS: yeah ok | 18:23 |
lisitsyn | HeikoS: so I guess I don't get to tomtom on friday | 18:23 |
lisitsyn | as I arrive slightly later than that | 18:23 |
@HeikoS | yes you will come on sat | 18:23 |
-!- HeikoS [~heiko@131.pool85-48-187.static.orange.es] has quit [Ping timeout: 245 seconds] | 18:47 | |
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has joined #shogun | 19:00 | |
shogun-buildbot | Build deb3 - interfaces #2 is complete: Success [build successful] - https://buildbot.shogun.ml/#builders/36/builds/2 | 19:38 |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 20:37 | |
-!- mode/#shogun [+o wiking] by ChanServ | 20:37 | |
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has quit [Quit: Page closed] | 21:10 | |
--- Log closed Wed Jun 05 00:00:45 2019 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!