Skip to content

AFHMM and AFHMM SAC: limit number of processes #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
klemenjak opened this issue May 4, 2020 · 17 comments · May be fixed by #37
Open

AFHMM and AFHMM SAC: limit number of processes #27

klemenjak opened this issue May 4, 2020 · 17 comments · May be fixed by #37
Assignees
Labels
enhancement New feature or request

Comments

@klemenjak
Copy link
Collaborator

Hi there,

this is not an issue but rather something I was wondering about.

While running AFHMM and AFHMM + SAC in my experiments, I recognized that those approaches really occupy a lot of CPU power. Even our simulation servers struggle with those algorithms sometimes.

Have you thought about providing a single-thread implementation of disaggregate_chunk ? Is it possible to limit the number of created threads in an easy manner?

Feel free to ignore this :)

Best,
C

@Rithwikksvr
Copy link
Collaborator

Rithwikksvr commented May 5, 2020

Hey @klemenjak

If you increase the 'time_period' parameter value of the AFHMM or AFHMM-SAC, you can decrease the number of threads.

First, we break the input sequence into multiple chunks of length 'time_period'. Each of those chunks is given a thread.

So, by increasing the value of 'time_period', you can decrease the threads.

It takes more time to solve a thread if you increase the 'time_period' value.

For our buildsys-experiments, we used a powerful CPU system with many threads. We were using 'time_period':720, and even then it took a lot of time.

Hope this was helpful!

@klemenjak
Copy link
Collaborator Author

klemenjak commented May 5, 2020 via email

@Wusir2018
Copy link

Hi @klemenjak
Could you give me a example with AFHMM and AFHMM_SAC? I can't run them correctly.
Best,
Wu

@klemenjak
Copy link
Collaborator Author

Hi @Wusir2018,

I haven't tested that so far. Sorry.

@Wusir2018
Copy link

Hey @klemenjak
It doesn't matter. Thank you!

@Rithwikksvr
Copy link
Collaborator

HI @Wusir2018

What exactly you aren't able to run?

@Wusir2018
Copy link

Hey @Rithwikksvr ,
Thank you for your reply !
I can run mean, but I can't run AFHMM and AFHMM SAC. This is my code:
1
2

But it stopped here:
3

@Rithwikksvr
Copy link
Collaborator

Hey @Wusir2018

The AFHMM and AFHMM-SAC take significantly longer times for generating the testing predictions.

It takes a couple of hours to compute predictions for a single day

Also, us use a system with more CPUs

@Wusir2018
Copy link

Hey @Rithwikksvr ,
Thank you for your reply. It helps me a lot. It's my fault and my computer is poor.
I have a problem about RNN,WindowGRU with AMPDs data.
I can run REDD data with RNN,WindowGRU.
But I can't run AMPDs data, I think the sampling frequency of AMPDs data causes this problem. How can I solve this problem?

This is my code:
1
2

This is my error
3
4

@Rithwikksvr
Copy link
Collaborator

I'll run it once and get back to you by tomorrow

@Wusir2018
Copy link

Hi @Rithwikksvr ,
Thank you very much !
Best wishes !

@chaosimple
Copy link

Hi @Rithwikksvr,

I am new to this area, so I don't quite clear about what exactly does the AFHMM algorithm refer to?
Is it refer to the "Additive FHMM" or the "Approximate FHMM"?

@MingjunZhong
Copy link
Collaborator

@chaosimple I think it was referring to the additive FHMM model and the method solving it was an approximate method employing Second-Order Cone Programming (SOCP).

@PMeira
Copy link
Collaborator

PMeira commented Aug 26, 2020

@chaosimple Check the README on the front page of the repository. The paper linked there should list the references: https://github.com/nilmtk/nilmtk-contrib/blob/master/README.md

(right now, the code is really missing some basic info as docstrings or comments)

@PMeira PMeira changed the title A suggestion for AFHMM and AFHMM SAC AFHMM and AFHMM SAC: limit number of processes Aug 26, 2020
@levaphenyl
Copy link
Collaborator

Note: processes of AFHMM and AFHMM+SAC should be daemonic. In case the OS kills the main process, e.g. because of memory pressure, the current implementation leaves tons of wild orphaned processes behind.

@Rithwikksvr
Copy link
Collaborator

Rithwikksvr commented Oct 6, 2020

But @levaphenyl , do you know any fix we can use for this?

levaphenyl added a commit to levaphenyl/nilmtk-contrib that referenced this issue Oct 7, 2020
@levaphenyl
Copy link
Collaborator

But @levaphenyl , do you know any fix we can use for this?

Yes, @Rithwikksvr. I use multiprocessing.Pool in my PR.

@klemenjak, I refactored AFHMM+SAC to use all CPUs - 1. Is it compatible with your original intent?

@levaphenyl levaphenyl self-assigned this Dec 2, 2020
@levaphenyl levaphenyl added the enhancement New feature or request label Dec 2, 2020
levaphenyl added a commit to levaphenyl/nilmtk-contrib that referenced this issue May 9, 2021
levaphenyl added a commit to levaphenyl/nilmtk-contrib that referenced this issue May 16, 2021
levaphenyl added a commit to levaphenyl/nilmtk-contrib that referenced this issue May 16, 2021
levaphenyl added a commit to levaphenyl/nilmtk-contrib that referenced this issue May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
7 participants