Repository navigation
Add GeneratorRecording for testing and diagnosing memory issues - #1391
Conversation
|
Hi Ramon. This is super cool and very usefull. This random recording will be also usefull for generating fake recording efficiently. |
Yes I wrote in the documentation that this is not consistent so it can only be used to test form and not values: spikeinterface/spikeinterface/core/generate.py Lines 370 to 373 in e401bbe My original intention was to revamp the Then there is the rabbit hole: But if you call I was that I was doing early optimization and I decided to leave that problem for later. |
|
I think we could have some thinkg like this. seed = an external number
rng = np.rnadom.default_rng([segment_index, start_frame])
traces = rng.random((num_sample, num_channel))I have tested but I guess that for a given chunk_size we should have the same results independing the number of n_jobs which is not so bad. |
|
@samuelgarcia unique_seed_hash = (start_frame, end_frame, segment_index, fix_class_seed)
rng = np.random.default_rng(seed=unique_seed_hash)
traces = self.rng.random(...)Should work to generate consistent traces, but you still have the problem that I described above:
Check the latest changes, I implemented a deterministic function. It now returns a deterministic generator very similar to the one in the What do you think? |
LazyRandomRecording for testing and diagnosing memory issuesGeneratorRecording for testing and diagnosing memory issues
|
@alejoe91 @samuelgarcia However, the sorting view tests seems to be failing here, any idea on why this could be? This test is also failing on master: |
Recently we had some memory issues: #1234
As @samuelgarcia pointed out, this is more likely the result of known problems with memmap in numpy and we are discussing long-term solutions to this.
That said, memory problems come both from reading and writing. We write recorder objects for many reasons including long-term storage, serialization, marshalling and reading from docker. The aim of this PR is to introduce a testing tool for memory related problems while writing
LazyRandomRecording.The
LazyRandomRecordinggenerates traces samples of any desired size and structure on the fly. That is, it does not read and should not keep a reference to the data. In general, it can be used to stress-test the processing and writing parts of any pipeline in high memory load scenarios. This can be accomplished because it decouples reading (which is required in any other recorder that produces a lot of data) from processing or writing. As an example, a specific use case is to test how theChunkRecordingExecutorhandle traces chunks of different sizes in high memory load scenarios.I added some tests and a convenience wrapper as that seems to be a standard practice that both @alejoe91 and @samuelgarcia. I am not completly satisfied with the name so any suggestions are welcome.
What do you guys think?